You are on page 1of 100

YOUR OFFICIAL RASPBERRY PI MAGAZINE

+UUWG &GEGODGT OCIRKEE 6JGQHƓEKCN4CURDGTT[2KOCIC\KPG

£5.99

OVERCLOCK & BENCHMARK RASPBERRY PI 5


WELCOME

WELCOME
to The MagPi 136

T
here’s a lot of excitement around Raspberry Pi
thanks to the ongoing waves of Raspberry Pi 5’s epic
launch.
We’ve got a lot of Raspberry Pi 5 coverage this month. From
in-depth heating, cooling and thermal testing (page 66) to Lucy

EDITOR
benchmarking (page 72). We’ve also got an in-depth guide Hattersley
to Overclocking (page 42). Lucy is editor of
The MagPi and has
Once you’re done speed testing and overclocking your new thoroughly enjoyed
overclocking
Raspberry Pi 5 you’ll want to make something with it. Check her Raspberry
Pi. Next up is a
out our Buyer’s Guide (page 32). This is packed with present seriously fast retro
ideas for the holiday season. From dynamic robots to weather KEQMRKcTVSNIGX

magpi.cc
trackers this feature is packed with gifts that will put a smile
on any maker’s face.
Happy holidays!

Lucy Hattersley Editor GET A


RASPBERRY PI
PICO W
PAGE 30

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

New subscribers to The MagPi will get a Priority Boarding


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

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

Contents
> Issue 136 > December 2023

Cover Feature

32 Complete Raspberry Pi 32
Buyer’s Guide
Regulars
90 Your Letters
92 Community events calendar
97 Next Month
98 The Final Word

Project Showcases

08 Retro Pi World Radio


12 Confetti Bot
14 Pico Bubble Machine
16 RePalm 20
20 Badger and Fox Deterrent
24 Tide Clock
26 Pihome
28 Bullet Time Wedding Booth

08

Retro Pi World Radio Badger and Fox Deterrent

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

magpi.cc 05
CONTENTS

Tutorials 60 46
42 Overclock Raspberry Pi 5
46 Cloud gaming on Raspberry Pi 5
50 Python coding on Raspberry Pi 5
54 Remote control with TigerVNC
56 Using Ubuntu – part 2
Make a mecanum robot – part 2 Cloud gaming on Raspberry Pi 5
60 Make a mecanum robot – part 2

76
The Big Feature
66

PicoVision review

84
Benchmarking Raspberry Pi 5

Reviews
76 PicoVision
79 10 amazing 3D prints
82 Learn Scratch

Community
84 Odd Jayy interview
86 This Month in Raspberry Pi Odd Jayy interview

WIN RASPBERRY PI 5 95

1 OF 10 ACCESSORY PACKS
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
QER]SJXLIXSTMGWMR8LI2EK5MQEKE^MRIEVIHMǺIVIRXFIX[IIRGSYRXVMIWERHEVIEP[E]WWYFNIGXXSGLERKI=SYEVIVIWTSRWMFPIJSVYRHIVWXERHMRKXLIVIUYMVIQIRXWMR]SYVNYVMWHMGXMSR
and ensuring that you comply with them. Some manufacturers place limits on the use of their hardware which some projects or suggestions in The MagPi magazine may go beyond. It is
your responsibility to understand the manufacturer’s limits.

06 magpi.cc
PROJECT SHOWCASE

Retro Pi
World Radio
An old valve radio provides the ideal housing for this
nostalgic Raspberry Pi build, finds Rosie Hattersley

M
ost of the maker-interviewees who Raju describes himself as an AFOL (adult fan of
feature in The MagPi’s project showcase LEGO) and, as well as building his own Optimus
pages have a deep love of technology Prime, Hulkbuster and other complex kits, he has
and, often, a career in computing. Retro Pi World used the brightly-coloured bricks in his mission
Radio creator Raju Salubramanian is just such a _Z_PLNSST^VTO^LYO_SPT]Q]TPYO^SZb_ZNZOP3P
fellow, but he is also on a mission to teach the does this as a ‘coach’ for the FIRST LEGO League
next generation to code: something that exactly (ʭ]^_WPRZWPLR`PZ]R) in his home town of San Jose,
chimes with why Raspberry Pi exists in the .LWTQZ]YTL3PT^LWXZ^_L^MTRLQLYZQ=L^[MP]]d
Raju
MAKER

ʭ]^_[WLNP Pi as he is of LEGO, with multiple projects under


Subramanian
Software engineer
Raju loves
tinkering with tech,
assembling classic
characters from
LEGO and helping
kids get to grips
with code

magpi.cc/
worldradio

He posted a video
of his project on
YouTube showing
station selection

08 magpi.cc Retro Pi World Radio


PROJECT SHOWCASE

Python handles the GPIO


input from the rotary
knobs and converts
it into keyboard input
events, such as scrolling
for radio stations

Quick FACTS
> Raju and his partner
both love 3D
&RSPH[SSHIRVEHMSGEWI[MXLSǺGIRXVI 7ENY[VSXIEWMRKPITEKI printing projects
speaker has been turned into a world radio web app to display the
controlled via a 2GB Raspberry Pi 4 map and stations menu > And sell their
designs online

> This build would


cost roughly $275
if if you made it
Raju wanted something that would force us to slow down from scratch

in our current fast-paced digital world > But Raju was able
to repurpose many
components he
his belt and six Raspberry Pi boards in use around already owned
ST^SZXPYZ_LWWOT^NWZ^PO_ZST^[L]_YP] 
Despite his thoroughly modern career as a > Next, he’s going
software engineer in Silicon Valley and a CV that to tackle a
lists VMware and Google among his credits, Raju Raspberry Pi LEGO
SL^LQZYOYP^^QZ]_SPZWOOLd^ɭ4SLaPLWbLd^ Robotics project

WZaPO_Z_TYVP]LYO]P[`][Z^PZWOSL]ObL]P
_ZM`TWO^ZXP_STYRYPbɮSP^Ld^QLaZ`]TYR
=L^[MP]]d;TMZL]O^MPNL`^P_SPdL]Pɭ[P]QPN_ɮQZ]
_SP[]ZUPN_^SPWTVP^_ZbZ]VZY^TYNPɭ_SPdL]P^Z
PL^d_Z^P_`[LYORP_^_L]_PObT_Sɮ

A nod to nostalgia
For the retro radio build Raju wanted something
that would force us to slow down in our current
QL^_[LNPOOTRT_LWbZ]WO3P^Ld^_SPLYLWZR`P
controls of the radio are in some way the opposite
ZQSZbbPTY_P]LN_bT_SZ`]OPaTNP^_ZOLdbT_S
_Z`NSLYOaZTNP?SP[]ZUPN_bL^LW^ZXPLY__Z He posted a video of his project on YouTube showing station selection

Retro Pi World Radio magpi.cc 09


PROJECT SHOWCASE

Keep on improving
Raju had seen other retro radio upcycling projects
online, and was particularly keen on creating one
similar to this internet radio project:
magpi.cc/internetradio3P`^POL2-=L^[MP]]d
;TMPNL`^PSPɭYPPOPO_SPPc_]LSZ]^P[ZbP]ZQ
Raspberry Pi 4 to get experience with the map
OT^[WLdɮ3PMZ`RS__SPXLTYNZX[ZYPY_^Q]ZX
ZYWTYP^_Z]P^^`NSL^,OLQ]`T_
Sourcing a suitable radio and writing the
software interface were his main challenges,

Retro World Radio


can tune in to a vast
collection of internet
Radio.Garden remind Raju of his childhood of using analogue
streaming radio stations
provides a user- VYZM^_ZNSLYRP^_L_TZY^3T^WPYR_Sd^PL]NSQZ]
friendly global
station selector _SPTOPLWZWO]LOTZPaPY_`LWWdWPO_ZSTXNSZZ^TYR since backend engineering is his professional
one with a speaker to one side and enough space QZ]_Pɭ4 PYUZdPO_SPPc[P]TPYNPZQb]T_TYRLWW
_ZN`_Z`_LbTYOZbLYOʭ_LYPb TY^N]PPY3T^ _SP5LaL^N]T[_NZOPQZ]_SPOT^[WLdLYO4LX
=P_]ZBZ]WO=LOTZNLY_`YPTY_ZLaL^_NZWWPN_TZY ^_TWW _STYVTYRZQbLd^_ZTX[]ZaP_SPZaP]LWW
of internet streaming radio stations from around LP^_SP_TN=LU`OP^TRYPO_SPYPb[L]_^STX^PWQ
_SPRWZMPLYOQPL_`]P^LaTY_LRPXL[_ZM]Zb^P including a new front face for the radio, using
LYOʭYO]LOTZ^_]PLX^ CAD software to design and create some

The searchable Radio Garden site serves up stations from around the globe

10 magpi.cc Retro Pi World Radio


PROJECT SHOWCASE

Rig up a radio

Having sourced a lovely vintage radio


01 through eBay, Raju replaced the old backing
ÆŅ±ųÚ±ĹÚĀƋƋåÚĹåƵųŅƋ±ųƼåĹÏŅÚåųŸ±ĹÚĀƋƋåÚ±
Raspberry Pi and AudioDAC.
/[]TY_PO [L]_^3PLW^Zb]Z_P^ZQ_bL]P Raju bought an old
radio from eBay for its
for the Retro World Radio, making liberal
SǺGIRXVIWTIEOIVERH
use of existing SDKs and open source or free warm acoustics
ZYWTYPWTM]L]TP^
3PMPRLYbT_SLOPaPWZ[XPY_[WL_QZ]X`^TYR
a breadboard, which allowed him to test the
^ZQ_bL]P?SPʭ]^_aP]^TZYSLO_S]PP]Z_L]dVYZM^
mapped to Raspberry Pi’s GPIO pins, but Raju later
OPNTOPO_Z`^PQZ`]VYZM^?SP^P[`WWTYTY_P]YP_
^_]PLX^Q]ZX=LOTZ2L]OPYLYONLYMPNSZ^PYMd
WZNL_TZYL^bPWWL^RPY]P
3LaTYRNZX[WP_PO_SP]LOTZ[]ZUPN_=LU`T^
YZb RPL]TYR`[_ZNZXMTYPST^WZaPZQ_TYVP]TYR He used the
remaining cabinet
with tech with LEGO, and has recently acquired a space for the new
=L^[MP]]d;TEP]ZB radio menu
BåƚŸåÚƋĘåŞųåÏŅĹĀčƚųåÚƴåųŸĜŅĹŅü
02 Raspberry Pi OS Lite he found on Comitup
ƋŅĬ±ƚĹÏʱűƚƋŅĵ±ƋĜÏƵĜųåĬ域ÏŅĹĹåÏƋĜŅĹ×
magpi.cc/comitup

NodeJS controls backend functions and serves


03 up static images for the display. Raju’s build
details are at magpi.cc/worldradio.

Retro Pi World Radio magpi.cc 11


PROJECT SHOWCASE

Confetti Bot
Want a party to go off with a bang? Then you want a
device that fires confetti, as David Crookes explains

I
f you’re going to celebrate, then you should LWWNZYQP__TNLYYZY^L]PYZ__SP^LXP^TeP^ZPaPY
do so in style. So what better way than sending MP_bPPYM]LYO^^ZXP_TXP^_SPNWL^[bZ`WOYɪ_SZWO
L^_]PLXZQNZYQP__TʮdTYR_S]Z`RS_SPLT]L_L _SPNLYYZY^_]ZYRWdLYO_SPNLYYZYbZ`WO_`]YbT_S
[]P^^ZQLM`__ZY*?SL_ɪ^_SP[]PXT^PMPSTYO_SP _SPXZ_Z]bT_SZ`_[Z[[TYRLYd_STYR?SPNLMWP^
Confetti Bot, a small cannon that shoots small _Z_SPML__P]dL]P^_TWWSLYRTYRZ`_^ZSZ[PQ`WWdL
[TPNP^ZQNZWZ`]PO[L[P]MTZOPR]LOLMWPZQNZ`]^P ^PNZYOaP]^TZYbTWWPYNWZ^PPaP]d_STYRɮ
^VdbL]O^bT_SLOPNPY_LXZ`Y_ZQ[ZbP]BT_S
L=L^[MP]]d;T-L_T_^SPL]_T_ɪ^L]PWL_TaPWd Party time
Hazal
MAKER

TYPc[PY^TaPbLd_ZRP_L[L]_d^_L]_PO ?SP^ZQ_bL]PbL^b]T__PYTY;d_SZYXLVTYR`^PZQ
Mestci ?SPOPaTNPbL^N]PL_PO_ZXL]V_SP[`MWTNWL`YNS _SPATLX;d_SZY>/6ɭATLXɪ^NZX[L_TMTWT_dbT_SL
ZQATLXL^ZQ_bL]P[WL_QZ]XQZ]^XL]_XLNSTYP^ aL]TP_dZQSL]ObL]PNZX[ZYPY_^LWWZbPO^PLXWP^^
Hazal Mestci is a
Turkish technologist ?SPNZX[LYdɪ^[]ZUPN_XLYLRP]1LSXTYL,SXPO TY_PR]L_TZYɮ3LeLWPc[WLTY^ɭ4OTOYɪ_SLaP_Zb]T_P
and artist who lives bT]POLM`__ZYLYOLXZ_Z]_ZRP_SP]_Z[Z[NZYQP__T MLNVPYONZOP_ZLN_TaL_P_SP^[PNTʭNXZ_Z]4bL^
in NYC. Her day-
TYNPWPM]L_TZYZQ_SPXTWP^_ZYP `^TYRLYO4OTOYɪ_SLaP_Z`YOP]^_LYO_SPYT_^LYO
to-day life involves
building fun robots, /PaPWZ[P]LOaZNL_P3LeLW8P^_NT_SPY^`RRP^_PO R]T_^ZQNZX[`_TYRMZL]O^_ZMPLMWP_ZRP_L]PLOTYR
coding, drawing, _LVTYR_SPOPaTNPQ`]_SP]ɭ4_SZ`RS_bP^SZ`WO Q]ZXL[TY
reading, doing XLVP_ST^[]ZUPN_[]P^PY_LMWPLYOQ`WWdQ`YN_TZYLW ɭ?SLYV^_Z_SP;d_SZY>/6XZ^_ZQ_SP
sports, and cooking.
LYO[]ZaTOPL^_P[Md^_P[_`_Z]TLWQZ]ATLX`^P]^ boilerplate code was already dynamically created for
magpi.cc/ _ZQZWWZbɮ3LeLW^Ld^BSL_PXP]RPObL^LOPaTNP XP4Y_SPATLXL[[L^dZ`LOOdZ`]NZX[ZYPY_^
confettibot
_ZdZ`]NZYʭR_SP.ZOP>LX[WP_LML`_ZXL_TNLWWd
Fitting all the components RTaP^dZ`bZ]VTYRNZOP_ZRP_dZ`]]P^Z`]NP^>ZT_
TYT_TL_PO_SPMZL]OLYO_SPXZ_Z]L^4LOOPO_SPX
inside was the hardest part LYOTX[Z]_POLWW]PWPaLY_WTM]L]TP^QZ]XPɮ
,W_SZ`RS_SP.ZYQP__T-Z_bZ]V^bPWWL^T_
_SL_`^P^=L^[MP]]d;T-LYOLY7$#9XZ_Z] T^3LeLW ^Ld^T_NLYNP]_LTYWdMPTX[]ZaPOLYO
O]TaP]_Z_`]YL2;4:XZ_Z]bSPY_SPM`__ZYT^ ^SPSL^ ZYP[L]_TN`WL]TOPLTYXTYO%ɭ4bLY_
[]P^^PO_Z_]TRRP]_SP]PWPL^PZQNZYQP__Tɭ4NSZ^P to incorporate a camera and machine learning
ALERT! _Z`^P=L^[MP]]d;TO`P_ZT_^aP]^L_TWT_dLYOLMTWT_d NL[LMTWT_TP^^Z_SL_T_NLYL`_ZXL_TNLWWd]PWPL^P
_ZQ`YN_TZYL^LNZX[LN_LYOLʬZ]OLMWPNZX[`_TYR confetti when a person approaches my desk,” she
Make sure you handle [WL_QZ]Xɮ3LeLW^Ld^ɭ4_[]ZaTOPO_SPYPNP^^L]d ^Ld^ɭ4_bTWW^`][]T^P_SPXZYLRZZOOLdLYO
and use confetti
cannons carefully. NZX[`_TYR[ZbP]_ZNZY_]ZW_SPM`__ZYXZ_Z]LYO ^NL]P _SPXZYLMLOZYPɮ
Z_SP]SL]ObL]PNZX[ZYPY_^TYaZWaPOLYOT_^2;4:
allowed me to program and control the actions of
_SP.ZYQP__T-Z_ɮ

Tight squeeze
?SPOPaTNPT^NZYYPN_PO_ZLAML__P]d_ZXLVP
it portable, and the components are placed within
LYPYNWZ^`]POP^TRYPObT_S_SPL^^T^_LYNPZQ^PYTZ]
]ZMZ_TN^PYRTYPP]5P]PXd3dOP`^TYR_SP/.,/
[LNVLRP>ZWTOBZ]V^ɭ1T__TYRLWW_SPNZX[ZYPY_^
The motor driver TY^TOPbL^_SPSL]OP^_[L]_ɮ3LeLW^Ld^ɭ4SLO_Z
is an inexpensive
OP^TRYX`W_T[WPaP]^TZY^ZQ_SPPYNWZ^`]PLYO_P^_
but important
part of the build _SP[]Z_Z_d[PXLYd_TXP^4bL^LW^Z`YLbL]P_SL_

12 magpi.cc Confetti Bot


PROJECT SHOWCASE

The main device includes a


3D-printed enclosure with
When the button is the motor, motor driver and
pressed, the motor starts Raspberry Pi wired together
XSXYVRERHWIXWSǺXLI
confetti cannon, all
powered by a 12V battery

With a robot created


in the Viam app, and
the board and motor
GSRǻKYVIHEWMQTPI
code loop checks if the
button is being pressed Quick FACTS
> It makes use of
confetti cannons

> The device is


fully portable

> It uses the Viam


robotics-building
platform

> All the code is on


GitHub: magpi.cc/
confettibotgit

> There’s lots of


scope for expansion

Confetti Bot magpi.cc 13


PROJECT SHOWCASE

Pico Bubble Machine


A Syrian academic uses MicroPython to teach kids the joy of coding. By Rosie Hattersley

S
yrian electronic engineer Aula Jazmati
was amazed when she encountered her
ʭ]^_=L^[MP]]d;TTY“It was like
LXT]LNWPTYLNZ`Y_]d^`ʬP]TYRQ]ZXOTʯN`W_
circumstances”, so much so that Aula set about
^SL]TYR_SPUZdbT_S^_`OPY_^LYONSTWO]PYL^
LXPLY^_ZTY^[T]P_SPT]WZaPZQXLVTYR8LYd
=L^[MP]]d;TLYO3PcLMT_[]ZUPN_^WL_P],`WL
Aula Jazmati
MAKER

OPNTOPO_Z_LVPZYLXZ]PbSTX^TNLWN]PL_TZY
Aula has a ɧL;TNZ-`MMWP8LNSTYPɧʭR`]TYRɭ^ZL[M`MMWP^
doctorate in SLaPLWbLd^QL^NTYL_PONSTWO]PYLYOLO`W_^LWTVP
electronic ?SPdM]TYRUZdLYOPcNT_PXPY_N]PL_TYRMPL`_TQ`W
engineering and
uses her Raspberry ʮZL_TYR^[SP]P^_SL_]PʮPN_WTRS_TYXP^XP]T^TYR
Pi projects to inspire NZWZ`]^ɮ?ST^/4D[]ZUPN_LW^ZZʬP]^LYPcNT_TYR The water bath and motor prior to attaching Raspberry Pi Pico
other makers Z[[Z]_`YT_dQZ]NSTWO]PY_ZWPL]YLMZ`_PWPN_]ZYTN^
magpi.cc/aulaj ,_T_^^TX[WP^_bL^STYR`[WT\`TOLYOLWZZ[TY PYNZ`Y_P]PO_SPWZbNZ^_NZX[`_P]bSPYZY
bSTNS_ZQZ]XM`MMWP^T^LWW_SL_ɪ^YPPOPO_ZN]PL_P _SP S`Y_QZ]LRZZOaLW`P[]ZNP^^Z]bT_SLY
_ST^WZbNZ^_LYO[WLdQ`WOT^_]LN_TZY-`_SLaTYR^P_ PL^d_Z]PLO_PX[P]L_`]P^PY^Z]TY^TOPQZ]`^P
L[]PNPOPY_OPWTRS_TYR[`[TW^bT_SSP]M`TWO^LYO TY _SP]XLW^_`OTP^ɭ?S`^MPRLYXdQ]TPYO^ST[
^NTPYNPPc[P]TXPY_^,`WLbL^OP_P]XTYPO_ZOP^TRY bT_S_SPbZYOP]Q`W=L^[MP]]d;TMZL]OLYO4
^ZXP_STYR_SL_bZ`WONL_NS_SPT]TXLRTYL_TZYbSTWP _]LY^QP]]PO_SPPYP]RdZQWZaPLYOZ[_TXT^X_SL_
LW^ZPYNZ`]LRTYR_SPX_ZM`TWO_SPT]ZbYM`MMWP _SP=L^[MP]]d;TRLaPXP_ZXd^_`OPY_^LYO
XLNSTYPɭBT_S_ST^[]ZUPN_NSTWO]PYNLYPc[WZ]P PaP]dZYPL]Z`YOXPɮ>SP[L]_TN`WL]WdL[[]PNTL_P^
_SP^NTPYNPMPSTYO^ZL[M`MMWP^bSTWPSLaTYRQ`Y _SPZ[PY^Z`]NPL[[]ZLNSLYO_SPL__T_`OP_SL_
M`TWOTYR_SPT]ZbYXLNSTYPɮ^SP]PL^ZY^ ^NTPYNPT^QZ]PaP]dZYPQ]ZXLNZXX`YT_d_SL_
PY^`]P^Z_SP]^NLY]P^PL]NSLYOZaP]NZXPLYd
This diagram shows An amazing mentor _PNSYTNLWOTʯN`W_TP^_SPdPYNZ`Y_P]
how Pico is used to ,`WLSL^MPPY`^TYR=L^[MP]]d;TL^L_PLNSTYR
control the motor
ERHcVSXEXMRKHMWG ]P^Z`]NPTYSP]WLM^TYNP>SPʭ]^_ Spinning things out
?ST^[]ZUPN_TY_]ZO`NP^NSTWO]PY_ZML^TN
PWPN_]ZYTN^LYOPYNZ`]LRP^_SPT]N]PL_TaT_dbT_S
options to customise their bubble machine,
OP^TRYTYRLYOOPNZ]L_TYR_SPT]ZbY[WL^_TNOT^N^
Z]Pc[P]TXPY_bT_SOTʬP]PY_QLY^TeP^QZ]aL]dTYR
M`MMWP^TeP^-d[]ZR]LXXTYR_SP=L^[MP]]d;T
;TNZNSTWO]PYNLYWPL]YLMZ`_NZOTYRNZYNP[_^
^`NSL^WZZ[^NZYOT_TZYLW^LYOQ`YN_TZY^
?SPSPL]_ZQ,`WLɪ^M`MMWPXLNSTYPT^T_^
[P]QZ]L_PONT]N`WL][WL^_TNOT^NbSTNS[P]QZ]X^_SP
^LXP]ZWPL^LM`MMWPbLYOBSPY_SPOT^N]Z_L_P^
T_OT[^TY_ZL^ZL[^ZW`_TZYN]PL_TYRLʭWXZQ^ZL[
ZYT_^^`]QLNP^SPPc[WLTY^bSTWPLT]Q]ZX_SP
QLYMWZb^_S]Z`RS_SPSZWP^QZ]XTYRM`MMWP^_SL_
OP_LNSQ]ZX_SPOT^NLYOʮZL_LbLd,/.XZ_Z]
NZYYPN_PO_ZLY7$#O]TaP]NT]N`T_NZY_]ZW^MZ_S

14 magpi.cc Pico Bubble Machine


PROJECT SHOWCASE

Raspberry Pi Pico controls an


L298 motor that governs the
disc spin speed and therefore
how frequently bubbles appear

Mentor Aula encourages pupils to Soapy water is drawn up


customise both the disc to create from the water bottle trough
HMǺIVIRXFYFFPIIǺIGXWERHXLI and caught in the holes of Quick FACTS
bubble machine’s aesthetic design the spinning plastic disc
> Aula made a
point of upcycling
materials for
XLIcTVSNIGX

Soap bubbles have always > Reusing plastic


tools and
fascinated children and repurposing
electronic
adults alike components

_SPQLY^[PPOLYOOT^N]Z_L_TZY?SP^P^TRYLW^L]P > Though you could


[]ZaTOPOMd=L^[MP]]d;T;TNZLYOL[Z_PY_TZXP_P] design and 3D print
NZYYPN_PO_ZT_MdLY,/.[TY your own

ɭ=L^[MP]]d;T;TNZNZY_]ZW^bSPY_Z^_L]_LYO
> Aula loves the
^_Z[_SPXZ_Z]L^bPWWL^LOU`^_TYRT_^^[PPOLYO
Raspberry Pi
bL^_SPTOPLWNSZTNPɮ^Ld^,`WL4_LWWZb^SP]_Z
community
NLWTM]L_P_SP^[PPOL_bSTNS_SPOT^N]PWPL^P^_SP
M`MMWP^LYOSPW[^_ZZ[_TXT^PPYP]RdNZY^`X[_TZY > And is a long-
^ZMZ_S_SPML__P]dLYOVTO^ɪPYUZdXPY_WL^_^L^ term translation
Raspberry Pi Pico and motor hooked up and ready for
WZYRL^[Z^^TMWP Aula to test them volunteer for it

Pico Bubble Machine magpi.cc 15


PROJECT SHOWCASE

rePalm
You’ve got to hand it to Dmitry Grinberg – squeezing PalmOS 5 onto
Raspberry Pi Pico is no mean feat, as David Crookes discovers

Y
ou can’t run Raspberry Pi OS on a RP2040
microcontroller, but that doesn’t mean
Raspberry Pi Pico is too underpowered
for an operating system. As Dmitry Grinberg
has shown, it’s capable of running a port of the
classic PalmOS 5 – the mobile operating system
unveiled in 2002 – although it’s not been without
NZY^TOP]LMWPPʬZ]_
Dmitry
MAKER

;LWX:> bL^_SPʭ]^_aP]^TZYZQ;LWXɪ^
Grinberg Z[P]L_TYR^d^_PX_Z^`[[Z]_,=8OPaTNP^-PQZ]P
Dmitry is a tinkerer that, the OS, which dates back to 1996, ran on
from Austin, TX _SP 8Z_Z]ZWL!#6[]ZNP^^Z]WTYPɭ?SPXZaP_Z
who specialises ,=8bL^LMT_XZ]PTY_P]P^_TYRɮ/XT_]d^Ld^
in squeezing Raspberry Pi Pico connected to the CortextProg
every cycle out of
ɭ?SP]PbP]P]`XZ`]^LMZ`__SPWL]RPTY_P]YLW
(cortexprog.com), a Cortex-M debugger Dmitry created to
microcontrollers re-architecting of the OS at the time but no details read and write data from and to a microcontroller

magpi.cc/ bP]PVYZbY4Y_SPPYO_SP,..0>>NZX[LYdZQ
repalm 5L[LYMZ`RS__SP:>LYO_SL_bL^_SL_?SP^Z`]NP ɭ4_N`WXTYL_POTY_SP]PWPL^PZQ_SP^Z`]NP
NZOPbL^YPaP]]PWPL^POɮ earlier this year, and now one can bring up
BT_SLYZYRZTYRQL^NTYL_TZYbT_S;LWX:>ɧɭT_ PalmOS even on processors that it never
bL^_SPʭ]^_XZMTWP:>bT_SLYd^Z]_ZQ^`NNP^^ LN_`LWWd^`[[Z]_POWTVP_TYd.Z]_Pc8NZ]P^ɮ
and it gave the world the term ‘smartphone” /XT_]dNZY_TY`P^3LaTYR_]TPOY`XP]Z`^Z_SP]
– Dmitry says he wanted to see if he could put the MZL]O^Q]ZX>?8TN]ZPWPN_]ZYTN^ɪ>?81$
operating system on another device with minimal _Z_SP>?83"=;^SZbPO_SPXZ^_
NSLYRP^3PWZZVPOTY_ZPX`WL_TYR_SPSL]ObL]P []ZXT^Pɭ4SLOYPaP]PYNZ`Y_P]POL.Z]_Pc8
with success (check it out at magpi.cc/uarmɭ-`_ microcontroller that had enough RAM for
_SL_bL^NSPL_TYRɮSPNZY_TY`P^ɭ?SPRZLWbL^ ;LWX:>ɮSP^Ld^ɭ=;OZP^ɧ ML]PWdɧ ^Z4
to port it to new hardware, which is usually hard bLY_PO_Z_]dɮ
bT_SZ`_^Z`]NPNZOPM`_4ʭR`]PO4ɪO_]d
ɭ4VYPb_SL_TY_SPZ]dXZ^_ZQ_SPO]TaP]^ Screen time
were contained in the Device Abstraction Layer ?SPTOPLbL^_ZRP_;LWX:> ]`YYTYRZY
(DAL) module, with a few others being separate a Raspberry Pi Pico or other RP2040-based
>/NL]O^P]TLW[Z]_/8,4ʭR`]PO_SL_TQ4 development board and connect the device to a
managed to replace those modules with some ^`T_LMWP_Z`NS^N]PPY/XT_]d^Ld^_SPZYWdZYP
4b]Z_PXd^PWQ_SL__SP:>^SZ`WOLRLTYTY _SL_ ʭ_ST^]P\`T]PXPY_^bL^LWZbNZ^_ $$
theory, run on any ARM device with a compatible #TYNS_Z`NS^N]PPYOT^[WLdQ]ZXBLaP^SL]P
[]ZNP^^Z]ɧLYd[]ZNP^^Z]^`[[Z]_TYR,=8a? ZʬP]TYRL]P^ZW`_TZYZQŸ
Z],=8a ?L]NST_PN_`]Pɮ?ST^_PNSLOaPY_`]P ɭ4_T^L]P^ZW`_TZY_SL_;LWX:>^`[[Z]_^bPWWLYO
^[LYYPOX`W_T[WPdPL]^M`__SPPʬZ]_SL^NP]_LTYWd really this is about the applications – the OS itself
MPPYbZ]_SbSTWP OZP^YZ_NL]PLMZ`_^N]PPY]P^ZW`_TZYɮSP^Ld^

16 magpi.cc rePalm
PROJECT SHOWCASE

RP2040 is able to run an Dmitry hasn’t gone to the


YRQSHMǻIH5EPQ4FYX bother of creating a case.
only after a lot of hard work “Really, the PS2040 PalmOS is
QSVIQIWLS[MRKSǺƹLIWE]W

Quick FACTS
> The project ports
PalmOS 5 to
Raspberry Pi Pico

> It uses a custom


kernel to run
on Cortex-M
processors

> rePalm can be


replicated for less
than $20

> The biggest


problem is a lack
Capable of displaying 262,000 of RAM
colours, this Waveshare 2.8-inch
touchscreen display is nevertheless > The software can
being used to output in greyscale be downloaded
from Dmitry’s
website

rePalm magpi.cc 17
PROJECT SHOWCASE

Raspberry Pi Pico
is mounted on
the back of the
touchscreen display.
As Dmitry says, a
$1 microcontroller
is being used to
replicate what was
once a $400 device

ɭ,[[WTNL_TZY^bZ]VMP^_L_]P^ZW`_TZY^_SL_L]P also allowed the thing being tapped to be seen,


TY_PRP]X`W_T[WP^ZQ!Ÿ!LYOPc_]L^[LNPNLY bSTWPʭYRP]^L]P]PWL_TaPWdWL]RPLYOZM^N`]P
MP`^POQZ]_SPOdYLXTNTY[`_L]PL,Ÿ bSL_ dZ`_L[ɮ
resolution is not super common but is supported
]PWL_TaPWdbPWWɮ Ramming in RAM
Dmitry says it helped that the screen was easy ?SPXZ]P/XT_]d`^PO=;_SPXZ]PSP
_Z [`]NSL^Pɭ4_T^L[P_[PPaPZQXTYPbSPY ]PLWT^POT_bL^LRZZOʭ_QZ]_SP[]ZUPN_ɭ1T]^__SP
people publish a project and their parts list ;4:^d^_PXT^aP]daP]^L_TWPLWWZbTYRXP_Z[]P_PYO
TYNW`OP^ɩ_SL_ZYP_STYR4MZ`RS_L_LRL]LRP^LWP to be a RAM and a ROM to the host 68k processor
once’ or ‘an old tube my grandpa left me in his TY_SPNL^PZQ;LWX.L]ObSTWPLW^ZO]TaTYRXd
bTWWɪɮSPPc[WLTY^-`_T_bL^LW^ZTX[Z]_LY__Z OT^[WLdbT_SYZ.;@NdNWP^YPPOPO9ZZ_SP]XTN]Z
SLaPL]P^T^_TaP_Z`NS^N]PPY Z`__SP]PSL^LYd_STYR\`T_PWTVPT_ɮSP^Ld^
ɭ/PaTNP^_ZOLdL]POP^TRYPOQZ]NL[LNT_TaP ɭ>PNZYO_SP[P]QZ]XLYNPT^RZZO.Z]_Pc8
_Z`NS SPYNP_SPWL]RP_Z`NS_L]RP_^ɮSP^Ld^ may not be a very performant core per-cycles, but
ɭ;LWX:>[]POL_P^NSPL[NL[LNT_TaP_Z`NS^ZT_ _SPQLN__SL_4NLYPL^TWd]`YT_L_83e^`]PWd
is designed for resistive touch screens which [L[P]^ZaP]LWZ_ZQ_SL_ ?ST]O_SPOZN`XPY_L_TZY
YPPOPO\`T_PLMT_ZQ[]P^^`]P_ZbZ]VSPYNP OZP^YZ_^`NVLYO_ST^NLYYZ_MPZaP]^_L_PO
_SP QLN__SL_^_dW`^P^SLOLʭYP_T[?SPʭYP_T[ Whoever wrote the RP2040 docs needs a medal, a
MZY`^Z]LS`RMPNL`^PT_T^NWPL]LYOLNN`]L_Pɮ
F?SL_bZ`WOMP,WL^OLT],WWLYɧ0OH
-`__SL_ɪ^YZ__Z^Ld;TNZT^[P]QPN_ɭ?SP]PT^
barely enough RAM to turn around in, so it’s not
L[]LN_TNLW;LWX:>OPaTNPɮSPWLXPY_^ɭ;LWX:>
YPPO^L_WPL^_!6-ZQ=,8QZ]_SP^_Z]LRPSPL[
bSP]P_SPOL_LML^P^L]P^_Z]POLYOL_WPL^_#6-
of dynamic heap, where temporary allocations
NZXPQ]ZX_ZMZZ_
Dmitry has also ɭ8dVP]YPWLYO/,7YPPOLMZ`_6-QZ]T_^PWQ
found a way to wire LYObPLW^ZYPPO_Zʭ_L_WPL^_ZYPQ`WWQ]LXP
up external RAM to
the RP2040 in a way M`ʬP] F^N]PPYTXLRPHTY_Z_SP=,8,_Ÿ
that it’s writable,
ŸMT_^[P][TcPW_SPQ]LXPM`ʬP]T^LWXZ^_$6-
readable, and cached
(magpi.cc/romram) ,OOTYR_SL_`[RTaP^`^6-9Zb=;SL^

18 magpi.cc rePalm
PROJECT SHOWCASE

Getting to grips with PalmOS

The project began as an experiment. Dmitry


01 Ƶ±ĹƋåÚƋŅĀčƚųåŅƚƋĘŅƵ{±Ĭĵk„ĂƵ±ŸÆƚĜĬƋ
±ĹÚĘŅƵĜƋƵŅųĩåÚţkƋĘåųƋʱĹųåŞĬ±ÏĜĹčƋĘå%eX
ĵŅÚƚĬåØƋĘåųåŸƋŅüƋĘåkaĜĵ±čåƋʱƋųƚĹŸĜŸƋĘå
ƚĹĵŅÚĜĀåÚ{±Ĭĵk„ţ
The rePalm device
 !6-ZQ=,8ɧ _SPZ_SP][TPNP^L]PYZ_PL^TWd looks very much
`^LMWPQZ]aL]TZ`^]PL^ZY^?ST^T^_TRS_M`_T_ at home here. It
can force-pause
ʭ_^ ?SL_6-bL^LQ_P]LWZ_ZQPc_]LbZ]V4[`_ threats, disable
task switching,
TY _Z^S]TYV_SL_QZZ_[]TY_4YT_TLWWdT_bL^NWZ^P] and supports local
_Z 6-ɮ thread storage

Looking ahead
?ST^LWWXPLY^;LWX:> U`^_LMZ`_ML]PWdʭ_^ZY
Raspberry Pi Pico and, once it boots, only basic
[]ZR]LX^]`YbT_SLQPb6-ZQ=,8WPQ_ZaP]QZ]L
XPXZ[LOYZ_PZ]_bZ?SP]Pɪ^YZ_PYZ`RS=,8
to load a game, and Dmitry would love an RP2040
bT_SXZ]P=,8ɭ4_bZ`WObZ]VMP__P]ɮSP^Ld^
)ƴåųƼüå±ƋƚųåƋʱƋåƻĜŸƋåÚĜĹ{±Ĭĵk„ĜŸ
02 ±ƴ±ĜĬ±ÆĬåôĜĹÏĬƚÚĜĹčåƴåųƼÆƚčô±ĹÚƋʱƋ
There is barely enough RAM to ĵ±ĩåŸƋĘåÆƚĜĬÚčųå±ƋüŅųŸŅüƋƵ±ųåÏŅĵޱƋĜÆĜĬĜƋƼØ
%ĵĜƋųƼŸ±ƼŸţ‰Ęåk„ϱĹÆåűƴĜč±ƋåÚƚŸĜĹč±
turn around in, so it’s not a ŸƋƼĬƚŸØģƚŸƋ±Ÿ{±ĬĵÚåƴĜÏåŸƵåųåƱÏĩĜĹƋĘåÚ±Ƽţ

practical PalmOS device


Still, rePalm is a huge feat that deserves a lot of
L[[WL`^P3Z`]^LYOSZ`]^ZQOT^L^^PXMWdbPY_
into its creation and using it shows how well
N]PL_PO;LWX:>bL^ɭ?SP]`WP^bP]P^TX[WP% LYd
common activity should be no more than two
OPaTNPTY_P]LN_TZY^LbLdɮ/XT_]d ^Ld^ɭ;PZ[WP
who want a modern PalmOS device don’t seek
_Z]P[WLNP_SPT][SZYP?SPd^PPV_ZP^NL[P_SP
NZY^_LY_LOaP]_T^PXPY_^LYOOT^_]LN_TZY^ɮ
%ĵĜƋųƼʱŸÏŅĹŸĜÚåųåÚƚŸĜĹč±ŸŞÆåųųƼ{Ĝ
With rePalm, he is showing once more what 03 {ĜÏŅœ×ŮƚƋƋŅƚŸåĬƚåƋŅŅƋĘØƼŅƚűÚĹååÚƋŅ
T^[Z^^TMWPɭ.`]]PY_[WLY^TYNW`OPXLVTYRL
ŸåĹÚŅųųåÏåĜƴåƋĘĜĹčŸ±ĹÚƋŅƚŸåœĜě8ĜØƼŅƚűÚƵ±ĹƋ
PalmOS-based smartwatch as well as a new ±ƵåÆÆųŅƵŸåųØåĵ±ĜĬÏĬĜåĹƋŅųÏʱƋ±ŞŞţ‰ĘåųåĜŸĹŅƋ
;LWX:>ML^POOPaTNPɮSPLOO^ åĹŅƚčĘeaüŅųƋʱƋţŰ
BSd*ɭ5`^_MPNL`^Pɮ

rePalm magpi.cc 19
PROJECT SHOWCASE

Badger and Fox


Deterrent
Warning!
Working with
animals
Please be mindful when
creating devices that
Scaring off unwelcome garden visitors with a interact with animals.
Read the RSPCA’s guide
on deterrents and animal
nocturnal scarecrow simply screamed Raspberry Pi population control.

magpi.cc/
project for one maker, learns Rosie Hattersley rspcadeterrents

M
oving house is stressful enough; ^TRYTʭNLY_NZX[`_PNL[LMTWT_TP^ZQ=L^[MP]]d;T
unpacking only to discover your new 4 prompted him to explore its machine learning
garden is favoured by unexpected potential at home.
local wildlife that doesn’t respond to unsubtle
hints is unsettling too. Software engineer James Inaudible alarm bells
Milward decided on a technology-based approach Having moved house in 2022, James and his
to tackling his night-time visitors, creating a family quickly discovered an issue with their
Badger and Fox Deterrent based around Raspberry new home: local foxes and badgers “loved
James
MAKER

Pi 4 and some machine learning. With a day job ripping the garden up, digging deep holes
Milward involving data and AI, James already had a fair and leaving ‘gifts’ everywhere for us”. Most
clue of how to go about it. disturbingly, they brought in insects carrying
James is a software
engineer for a He had a number of Raspberry Pis at home who knew what in terms of germs and potentially
company that and built a solar-powered watering system harmful diseases. Once local wildlife experts
manages data and using Raspberry Pi A+ back in 2015. He says NZYʭ]XPO_SP^PʮPL^LYO_TNV^bP]POPʭYT_PWd
uses AI and enjoys
3D printing and the low-powered footprint paired with the from their garden visitors, James was “set on a
creating electronic
projects

medium.com/@
james.milward

)MǺIVIRXJVIUYIRGMIW
[EVRSǺJS\IWERH
badgers, respectively

20 magpi.cc Badger and Fox Deterrent


PROJECT SHOWCASE

+SSXEKIJVSQXLI[MVIPIWW
deterrent can be viewed
VIQSXIP][LMPIYR[IPGSQI
ZMWMXSVWKIXE[EVRMRK
EYHMFPISRP]XSXLIQ

Quick FACTS
> TensorFlow Lite
draws less than 6W
on Raspberry Pi
James repurposed an He used TensorFlow
ultrasonic wildlife deterrent to 1MXIcQEGLMRIPIEVRMRKSR > Even while
EYXSQEXMGEPP]HIXIGXHMǺIVIRX Raspberry Pi to detect foxes EGXMZIP]cTVSGIWWMRK
types of nocturnal visitor ERHFEHKIVWFYXXVEMRIHMXXS images and cross-
MKRSVISXLIVQSZMRKSFNIGXW checking them

> The challenge


for James was
implementing this
on night images

> *\XVEGXMRKYWEFPI
accurate video
footage across
EcPEVKIEVIE
path to create a deterrent that could help with
our problem”. > And at more
He initially tried scent-marking repellent XLERcX[SJVEQIW
and natural mixes of citronella and chilli, TIVcWIGSRH
blocking entry points along the fences in the
RL]OPYM`_ɭ?ST^U`^_]P^`W_POTYZ`]ʮ`ʬd
friends ignoring my initial attempts and digging
XZ]PSZWP^ɮ3P_]TPOZYP^ZW`_TZY_SL_ZʬP]PO
a glimmer of hope: solar-powered ultrasonic
repellents. The Milwards duly placed a few around
their garden. However, the repellents required
manual setting depending on whether it was
MLORP]^Z]QZcP^_SPdbLY_PO_ZbL]YZʬL^bPWW
as deactivating so as not to trigger when the
family was in the garden. This led to occasions
when no ultrasonic repellent was in use, and
a further incursion of wildlife. Combined with
inconsistent charging of the solar-powered units,
James realised he needed something smarter: 8LI8IRWSV+PS[1MXIW]WXIQWYGGIWWJYPP]VIGSKRMWIWEZMWMXMRKFEHKIVI\TPSVMRK/EQIWƶKEVHIR

Badger and Fox Deterrent magpi.cc 21


PROJECT SHOWCASE

A Ring doorbell
camera added Raspberry Pi was the perfect Raspberry Pi would be the perfect choice to help
add some intelligence to these very basic devices.
XSXLIcWIXYTEPWS
triggers an alarm
choice to add some intelligence
Tense, nervous, headache
to these very basic devices James had already experimented with TensorFlow
LYOʭR`]PO_SPNZXMTYL_TZY
of this open-source machine
learning platform’s object
recognition capabilities
and Raspberry Pi could
work well for his Fox and
Badger Deterrent, modifying
the ultrasonic repellent
for remote use. By adding
wireless connectivity and an
ESP8266 microprocessor, he
would even be able to have
the repellent operate at a
targeted frequency range to
“accurately deter targets”.
The project’s real headache
8LIJS\ERHFEHKIV came when trying to get video
detector machine
learning to detect frame rates good enough
XLIcX[SERMQEPW
for object detection at a

22 magpi.cc Badger and Fox Deterrent


PROJECT SHOWCASE

Scare the cat!

The machine learning


QSHIPMHIRXMJ]MRKEJS\

resolution of 640×640 pixels. James used existing


YouTube tutorials designed for 320×320 models,
but soon found that more detailed images would
be needed, and set about reducing the complexity
of the model without losing too much accuracy. You will need at least one solar ultrasonic
Unfortunately, this method brought the frame rate 01 repellent device, Raspberry Pi 4, a Ring
`[_ZU`^_`YOP] 1;>bSTNSbL^ʭYPQZ]L^TYRWP camera or compatible RTSP webcam, Arduino
video stream, but James had built the code to work ESP2866, a wireless connection and power supply.
on multiple cameras at once. He then discovered James details the build at magpi.cc/deterfox.
that the Coral USB Accelerator Edge TPU works
superbly with Raspberry Pi 4, which has the
necessary USB 3.0 ports. “I was able to use this
device to get the frame rate for object detection up
A badger detected
to 5 FPS for one video feed and about 2 FPS for two
EVSYRHXLIǼS[IV
feeds running concurrently.” pots in the garden

FĹŸƋ±ĬĬ±ĹÚÏŅĹĀčƚųåI±ĵåŸű{ƼƋĘŅĹ
02 application onto Raspberry Pi 4 or 5 alongside
a Coral USB3 Edge TPU (Tensor Processing Unit).

Modify the ultrasonic deterrent following


03 James’ GitHub, which has pretrained the object
detection module to discern badgers and foxes
(magpi.cc/tfanimal). You will also need a housing
üŅųƤƋĘåÚåƴĜÏå±ĹÚ±ĵå±ĹŸŅüĵŅƚĹƋĜĹčĜƋţ

Badger and Fox Deterrent magpi.cc 23


PROJECT SHOWCASE

Tide Clock
How do you know the tide is right for a walk? If you’re
Levi Maaia, you create a special – and very pretty
– tide clock. Rob Zwetsloot braves the seas for a look

I
f you’ve ever lived near the sea, you’ll know be found here. As it turns out, there’s a good
that it never gets old to walk along the ]PL^ZY QZ]_SL_>TXTWL]_ZXLYdNZL^_LWL]PL^
beach, especially when the weather is good. L]Z`YO _SP;LNTʭNLYO^ZXPZQ_SPYZ]_SP]Y
For Levi Maaia, it turned out the weather wasn’t Mediterranean coast, the US west coast has a
the main problem. XZ]P NZX[WPc_TOLW[L__P]YbSTNSXPLY^_SL_
ɭ4WTaPQPP_LMZaP_SP;LNTʭNZYLYZNPLY bT_SZ`_NZY^_LY_LOU`^_XPY_LML^TN_TOPNWZNV
NWTʬɮ7PaTPc[WLTY^ɭ4_]d_ZXLVPT_LbPPVWd]T_`LW bZ`WORP_Z`_ZQ^dYNbT_S_SPɩXTcPO^PXTOT`]YLWɪ
_ZbLWVOZbY_SPNWTʬ_Z_SP^SZ]P3ZbPaP]T_ɪ^ _TOP^SP]PTYU`^_LQPbOLd^ɮ
Levi
MAKER

OT^L[[ZTY_TYR_Z]PLNS_SP^PL^TOP^_LT]^Pc[PN_TYRL ?ST^XPLY_7PaTYPPOPOLbLd_ZVPP[_SPNWZNV
Maaia YTNP^LYOdbLWVZYWd_ZʭYObLaP^WL[[TYRLRLTY^_ `[_ZOL_PbT_S_SP9:,,9L_TZYLW:NPLYTNLYO
_SPML^PZQ_SPMW`ʬɮ Atmospheric Administration) tide data, which led
A researcher,
ǻPQQEOIVERH 1Z]`^WLYOW`MMP]^_TOP^L]PYɪ_LWbLd^^ZXP_STYR STX_Z_`]Y_Z=L^[MP]]d;Tɭ?SPOPaTNP^_Ld^
IHYGEXSV1IZMPMOIW bPSLaP_Z_STYVLMZ`_LW_SZ`RS7PaTbL^QLXTWTL]
XSXMROIV[MXLXIGL
ERHPIEVREFSYXXLI
TISTPI[LSXMROIV
bT_S_SP_TOPNWZNV^bSP]PSPR]Pb`[9Z_MPTYR
LMWP_ZʭYOZYPQZ]ST^YPb.LWTQZ]YTLYSZXP7PaT
All of the meters and
[MXLMXXSS OPNTOPO_ZXLVPST^ZbY%ɭ4_OT^[WLd^N`]]PY__TOP
SPTRS_TYQPP_[]POTN_POSZ`]^`Y_TWYPc__TOPLYO
lights are driven by
pathwaysto
invention.org []POTN_POSPTRS_ZQ_SPYPc__TOP`^TYRLYLWZR`P the GPIO pins on a
XP_P]^LYO70/WTRS_^ɮ
Raspberry Pi 3B+ running
Tidal changes
8LVTYRLNWZNVbL^Yɪ_\`T_PL^PL^dL^SPʭ]^_ a Python script that
thought, though.
“Growing up in Rhode Island, round, four- gathers tide predictions
^PRXPY_PO_TOPNWZNV^bP]PLNZXXZY^TRS_
8LI1*)WPIX]SY
ORS[MJMXƶWEKSSH TY SZXP^YPL]_SP,_WLY_TNɮ7PaT_PWW^`^ LNN`]L_PL^WZYRL^T_SL^LBT1TNZYYPN_TZYɮ7PaT
XMQIXSLIEHSYX
ɭ-`_ LQ_P] XZaTYR_Z.LWTQZ]YTL4YZ_TNPO_SL_ ^Ld^ɭ?SP]POWTRS_ZY_SP]TRS_^TOPZQ_SPQ]ZY_
[MXLcKVIIREWXLI
YWYEPƵKSƶWMKREP _SP^P^TX[WPLYLWZR`PNWZNV^bP]PYZbSP]P_Z panel indicates a rising tide and the green light on
the left illuminates when the tide is falling. All of
_SPXP_P]^LYOWTRS_^L]PO]TaPYMd_SP2;4:[TY^
ZYL=L^[MP]]d;T-]`YYTYRL;d_SZY^N]T[_
_SL_RL_SP]^_TOP[]POTN_TZY^Q]ZX_SP@>9L_TZYLW
:NPLYTNLYO,_XZ^[SP]TN,OXTYT^_]L_TZYɪ^,;4
The script converts the raw tidal data into PWM
aLW`P^_ZO]TaP_SPXP_P]^LYO_SPMTYL]d^_L_P
aZW_LRPQZ]_SP70/^ɮ

Sea worthy
As well as the electronic aspect of the project,
7PaT bL^VPPY_ZXLVPT_WZZVXZ]P]`^_TN_Z
NLXZ`ʮLRP_SPTY_P]YLW_PNS`^TYRLYLWZR`P
RL`RP^ LYOLbZZOPYQL^NTLɭ:MaTZ`^Wd_SP]P

24 magpi.cc Tide Clock


PROJECT SHOWCASE

A temporary wooden box


for the electronics that
maintains a rustic look

The required wooden


pelican to indicate
this is a coastal house

Quick FACTS
All the information > ,SLEV2Y^EQQMP
you’ll need before LIPTIH[MXLXLI
taking a stroll 5]XLSRGSHI
HS[RXLIGPMǺ
> 1IZM[ERXWXSQEOI
EHYVEFPI[SSHIR
IRGPSWYVIJSVMX

> &7EWTFIVV]5M>IVS
L]P XZ]PPʯNTPY_bLd^_ZNZXX`YTNL_P_TOP [EWXVMIHSVMKMREPP]ƾ
[]POTN_TZY^_SLYbT_SLYLWZR`PXP_P]^ɮ7PaT
LOXT_^ɭ,OTRT_LWOT^[WLdO]TaPYMdL=L^[MP]]d;T > ƾLS[IZIVXLI
RIIHPIW[IVIE
NZ`WOPL^TWd^SZbR]L[S^LYOY`XMP]^ML^POZY
FMXNMXXIV]TSWWMFP]
the tide API. But I wanted something more rustic
HYIXSPEGOSJ
M`_U`^_L^LNN`]L_P?SPd^LdXPL^`]P_bTNPLYO TVSGIWWMRKTS[IV
N`_ZYNP4X`^_SLaP_TYVP]POXPY_LWWdbT_S_SP
[Sd^TNLWM`TWOOP^TRYL_SZ`^LYO_TXP^ZaP]_SP > 8LI&5.YWIWPMZI
[L^_ _bZdPL]^ HEXESRXMHILIMKLX
ɭ>ZbSPYT_ʭYLWWdNLXP_TXP_ZL^^PXMWPT_4 JSVXLILEVFSYV
SLOLaP]dNWPL]aT^TZYZQSZbT_^SZ`WOWZZVOZbY
_Z_SPM]L^^[WL\`POPNWL]TYR_SL__SPTYQZ]XL_TZY
OT^[WLdPObL^QZ]ɩ>LY_L-L]ML]L3L]MZ]ɪɮ
,NNZ]OTYR_Z7PaT_SPʭYT^SPO[]ZUPN_bZ]V^
ɩ]PLWWdbPWWɪbSTNSSZ[PQ`WWdXPLY^SPɪ^MPPYLMWP
_ZRZQZ]ST^bPPVWdbLWV^bT_SZ`_bZ]]dTYRLMZ`_
8LIKEYKIWERH1*)WEVIGSRXVSPPIH
the tide since completing it. F]XLI,5.4TMRWSR7EWTFIVV]5M

Tide Clock magpi.cc 25


PROJECT SHOWCASE

Pihome
Save money on energy bills using Raspberry Pi Pico?
It’s more likely than you think. Rob Zwetsloot takes a reading.

I
n the current climate, saving money on Efficient code
heating is something a lot of people are While initial work was done on Raspberry Pi,
interested in doing, so it’s no surprise that Thomas switched to Pico for the project.
someone decided to tackle this head on using “Raspberry Pi Pico W is used to collect
Raspberry Pi Pico W. temperature and humidity data sent by
“I’m using temperature and humidity trend ThermoBeacons and transmits it to a cloud
data for optimising my heating systems and application for further analysis,” Thomas says.
monitoring individual room temperatures and “Actual data is additionally shown on a local
Thomas
MAKER

humidity,” Thomas Ackermann tells us. He display and provided by a local web server running
Ackermann lives in Bavaria, which has a similar climate to on Pico W.”
the UK with distinct seasons and a temperature Thomas had to do some serious coding
A software engineer
since the ’90s, ranging from freezing in the winter to too hot wizardry to get everything to run properly on
Thomas started his (25-30 °C) in the summer. “Up until now I have Pico – including tracking down a memory leak
career writing C on
had three systems running: two systems for room in MicroPython.
Unix systems.
monitoring which I am using for rooms which “I had to extend the original Pico LCD driver
magpi.cc/ are not occupied currently and need monitoring _Z^`[[Z]_LNZYʭR`]LMWPQ]LXPM`ʬP]ɮPc[WLTY^
pihome
for deep temperatures and high humidity in the
winter. The other system is for optimising an old
oil heating system. The sensors are attached to the
This helped to identify
piping and so indicate when the individual pumps
for heating, hot water and hot water circulation,
a useless circulation
and the oil burner, are active.” pump which could be
Thomas began this project with the goal of
refreshing his Unix/Linux skills and learning disconnected and so
Python on Raspberry Pi – and has ended up with a
saving of about €700 (£609/$741) a year on oil. power could be saved

The hygrometer
is hidden away
by some pipes to
take readings

26 magpi.cc Pihome
PROJECT SHOWCASE

Live readings can be seen at This hygrometer


a glance without needing to is used to take
log onto the cloud database humidity readings
for the system

This Bluetooth
ThermoBeacon
sends sensor
Quick FACTS
data to Pico
> The code makes
use of asyncio for
multitasking on Pico

Thomas. “This is used to have enough free memory heating system; the real temperature was 5 °C
> Data is sent to
for the https communication to the cloud service” higher than the temperature measured from the
XLIc8LMRKTIEO
You can get the full code at magpi.cc/pihome heating controller and so the hot water pump cloud platform…
was activated too often. Finally it was used to
What a savings XPL^`]P_SPPʬPN_ZQLOOPOTY^`WL_TZY?SP > …which also
With the data collected from his sensors, Thomas M`]YP] _PX[P]L_`]P^L]P^TRYTʭNLY_WdWZbP] includes diagnostic
was able to make some interesting discoveries. with the new insulation.” data on how Pico
“This helped to identify a useless circulation Now that Thomas has taken his project MWcTIVJSVQMRK
pump which could be disconnected and so this far, he’s keen to add more Bluetooth
power could be saved,” Thomas says. “It was also beacons and more types of sensor to the overall > 8.IRWSV8EKW[IVI
switched out for
used to track down a problem with an incorrect system. Here’s hoping it helps him save even
ThermoBeacons
hot water temperature measurement in the more money…
> With a smart
thermostat, a
project like this
could control
]SYVcLIEXMRK

You can get readings


from Picos dotted
around the house

Pihome magpi.cc 27
PROJECT SHOWCASE

Bullet Time wedding


photo booth
One maker used a dozen cameras and Raspberry Pi Pico to build
the ultimate action-packed photo booth. By Ashley Whittaker

I
f you’re already tiring of the wedding season, which the chosen one, played by Keanu Reeves,
this project isn’t going to make you feel any dodges bullets with an impressive backbend.
better. Sebastian Staacks has out-gifted us all. You might also have heard of it as a frozen
No serving spoon sets or gift vouchers here. For XZXPY_OPLO_TXPʮZbXZ_TZYZ]_TXP
his cousin’s wedding he made a bullet time photo slice video.
booth using an array of DSLR cameras triggered by “My cousin asked me if I could build a photo
Raspberry Pi Picos. booth for his wedding,” explains Sebastian,
“where guests could create fun memories with
Sebastian
MAKER

Staacks What does bullet time mean? props like hats and giant glasses. I wanted to try
Bullet time photo booths comprise multiple something fancier. A video booth with a bullet
Sebastian is a cameras rigged together. Each camera takes a _TXP PʬPN_ɮ
physicist and photograph at the same moment simultaneously,
the developer of
phyphox (phyphox.
or with a small delay between them. Software then A three-Pico wedding
org). He is a father joins each of the photographs to create a video ?bPWaPNLXP]L^L]PL__LNSPO_ZLN`]aPO]TR_SL_
of two, a drummer, bT_S_SP^_]TVTYRɭM`WWP__TXPɮPʬPN_?SPPʬPN_ looks a bit like a ballet barre. Look at the image
coder, and maker. is best known for – and indeed named after – its and you’ll notice the cameras are placed at greater
staacks.de use in The Matrix (magpi.cc/matrixbullettime) in distances apart towards the wall on the left,
LYOX`NSNWZ^P]_ZRP_SP]ZY_SPZ_SP]PYO?ST^
The green button is used to start the recording
GSYRXHS[RERHXSGSRǻVQXLEXEVIGSVHMRK achieves the impression of the action accelerating
should be kept when the guests review their when the shots are played back in sequence.
result. The red button discards the recording
“I set myself a limit of €50 [£43.50] per
camera,” says Sebastian. “which means that the 12
cameras alone would cost €600 [£521].”
Sebastian did consider Raspberry Pi Camera
Module but decided on picking up extremely
old DSLR cameras instead, picking “the oldest
mainstream beginner DSLR that has a decent
resolution”. He settled on 12 10MP Canon EOS
400D cameras, which he picked up on Craigslist.
A Raspberry Pi Pico (magpi.cc/pico) acts as the
camera trigger. It has to make sure all the camera
shutters go simultaneously in order for the bullet
_TXPPʬPN__ZbZ]V?bZQ`]_SP]=L^[MP]]d;T
Pico Ws sit inside Bluetooth wireless buttons so
_SPbPOOTYRR`P^_^NLYNZY_]ZW_SPLN_TZY?SP
green button starts the countdown to a recording
and saves it, and the red button can cancel a
countdown, or trash it if everyone looks idiotic.

28 magpi.cc Bullet Time wedding photo booth


PROJECT SHOWCASE

8[IPZI(ERSR)GEQIVEWEVI A Sony a5000


WTEGIHSYX3SXMGILS[XLISRIW GEQIVEcMWYWIHXS
SRXLIPIJXEVIWTEGIHQSVIXLER KVEFXLITLSXSWEW
XLIVMKLXXLMWWTIIHWYTXLIZMWYEP EcZMHISǻPI
IǺIGXXS[EVHWXLIIRH

7EWTFIVV]5M5MGSMWYWIH
XSGSRXVSPXLIFYXXSRW Quick FACTS
ERHGEQIVEWFVMRKMRKEPP
XLIMRXIVEGXMSRWXSKIXLIV > Sebastian originally
made a standard
photo booth for
LMWcS[R[IHHMRK

> The EOS 400D has


a photo resolution
Raspberry Pi Pico acts of 3888×2592 pixels

as the camera trigger > More than the


3840×2160 used
7EWTFIVV]5M5MGSSǺIVWEWIVMEPMRXIVJEGIZME9'[LMGLTYPPW
either of the two signal lines of the trigger cable to ground MRcXLIǻREPZMHIS

> But the EOS


/LATYNT=P^ZWaP^ZQ_bL]PN]PL_PO_SPʭYLWaTOPZ
)cGERRSX
of all the shots stitched together. Its Optical Flow
VIGSVHcZMHISƾ
0^_TXL_TZYRPYP]L_POL]_TʭNTLWLOOT_TZYLWQ]LXP^
and allowed sections to be blurred or slowed down > ƾWSESR]E
_ZXLVTYR_SP^_T_NSTYRWZZVXZ]Pʮ`TO is used as a HDMI
grabbing device
Details, details, details
Sebastian created an incredibly detailed project
page (magpi.cc/tobbullettime) delving into each
element of the build, from the camera triggers to
building the rig and post-processing the images.
His GitHub (magpi.cc/bullettimegit) repo is also
a treasure trove of all the code you’ll need to build Raspberry Pi Pico
;ǻXWMRXSXLITYWL
your own and become the most popular wedding
buttons with two
guest ever. Well, maybe next wedding season. AA batteries

Bullet Time wedding photo booth magpi.cc 29


SUBSCRIPTION

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

Exclusive Offers
Great gifts, offers, and discounts

Great Savings
Save up to 23% compared to stores

Subscribe for £10


Free Pico W
3 issues of The MagPi

GET Priority Boarding code


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

+ 6 issues of The MagPi


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

Subscribe by phone: 01293 312193


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

30 magpi.cc
SUBSCRIPTION

SUBSCRIBE TODAY AND GET A


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

A brand new RP2040-


based Raspberry Pi Pico
$6
W development board

Learn to code with


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

New subscribers to The MagPi


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

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

magpi.cc 31
RASPBERRY PI
Everything you
need for starting
your Raspberry
3LbDGYHQWXUH

R
aspberry Pi is an incredible device that
can empower people to do, well, just
about anything. It can’t do it all on its
own though without the help of the incredible
accessories, add-ons, and kits available.
Whether you got a new Raspberry Pi 5 over the
holiday season or looking for something new to
do with your existing boards, we’ve put together
LOPʭYT_TaPWT^_ZQP^^PY_TLWLYOYZ_P^^PY_TLW
but-very-cool items for you to peruse that could
help kickstart your next project.
Let’s get making.

32 magpi.cc Complete Raspberry Pi Buyer’s Guide


HOW TO BUY
The best place to buy a Raspberry Pi 5 – or
any other kind of Raspberry Pi! - is from an
Approved Reseller. This is a network of shops
and online stores that work with Raspberry Pi
_ZOT^_]TM`_PSL]ObL]PLYOdZ`NLYʭYOWT^_^
of which ones have stock in your country from
the product pages on the Raspberry Pi website:
raspberrypi.com/products

There’s still time to get Priority Boarding


codes! Existing and new subscribers to the print
edition of The MagPi and Hackspace magazine
will get a code that lets them order and receive
their Raspberry Pi 5 earlier than others.
Check out page 4 for more details, or head to
magpi.cc/priorityboarding

Complete Raspberry Pi Buyer’s Guide magpi.cc 33


THE ESSENTIALS
Accessories and add-ons that every
Raspberry Pi owner should have

THE BASICS OFFICIAL KEYBOARD


PRICE £20 / URL magpi.cc/keyboard

Type in style with this nifty keyboard


d
OFFICIAL CASE
E
PRICE £10 / URL magpi.cc/case

Protect and cool your Raspberry Pi

OFFICIAL MOUSE
U SE
US
PRICE £9 / URL magpi.cc/mouse
OFFICIAL
OFF
FICIAL
FICIA
POWER
WER SUPPLY
SUPP
PLY
PRICE £12 / URL magpi.cc/psu
ARGON
Make sure your Raspberry Pi
is properly powered
NEO CASE
PRICE £15 / URL magpi.cc/argonneo
HDMI TO MICRO
O
Add passive cooling with a great
HDMI CABLE looking aluminium case

PRICE £9 / URL magpi.cc/hdmi

Connect Raspberry Pi with no converters

34 magpi.cc Complete Raspberry Pi Buyer’s Guide


ACTIVE CASE
COOLER FAN
PRICE £5 / URL magpi.cc/activecooler PRICE £6 / URL magpi.cc/casefan

Keep your Raspberry Pi 5 cool Raspberry Pi 4 cooling solution

OTHER ACCESSORIES

MEDIA CENTRE CASE FLIRC IR DONGLE


PRICE £12 / URLQEKTMGGǼMVG^IVS PRICE £12 / URLQEKTMGGǼMVG

(EQSYǼEKI7EWTFIVV]5MYRHIV]SYV8: Remote control support for


7EWTFIVV]c5MQIHMEGIRXVIW

PICADE X HAT
PRICE £16 / URL magpi.cc/picadex

Turn your Raspberry Pi into an arcade cabinet

POE HAT
PRICE £23 / URL magpi.cc/poehat
RASPBERRY PI
Power-over-Ethernet for industry
CAMERA MODULE
PRICE £34 / URL magpi.cc/camera

Use AI vision or simply take photos

TV HAT
PRICE £16 / URL magpi.cc/tvhat

Watch Freeview via Raspberry Pi

Complete Raspberry Pi Buyer’s Guide magpi.cc 35


ELECTRONICS &
CIRCUITS
Take components and wires, and MULTIMETER
A good way to test your circuit
SURJUDPbWKHPZLWK5DVSEHUU\3L for any faults

ESSENTIAL ITEMS
SOLDERING IRON
Use liquid metal to join components

SOLDERING BREADBOARD PROTOTYPING


ACCESSORIES For quickly setting up test WIRE
circuits, a breadboard
A soldering stand, some solder, 9WMRKHMǺIVIRX
MWcIWWIRXMEP
ǼY\ERHEWSPHIVWYGOIV wire colours can
help you follow
your circuit and
identify issues

HELPING HANDS RESISTORS


-SPHǻHHP]TEVXW We like to have a variety
together to make SJcVIWMWXSVWXSLERHJSVE
soldering easy range of uses

WIRE
CUTTERS
A good pair of wire
cutters can also
strip them

36 magpi.cc Complete Raspberry Pi Buyer’s Guide


RASPBERRY PI PICO ADVANCED KIT WHERE TO BUY
PRICE £31 / URL magpi.cc/advpicokit COMPONENTS
Components like LEDs, buttons, sensors,
Another Pico-themed electronics kit, P_NL]PYZ__ZZSL]O_ZʭYOM`_bP
this one comes with a huge number recommend these sites in the UK for
SJHMǺIVIRXIPIGXVSRMGGSQTSRIRXW buying components:
to chose from. There’s 32 tutorials shop.pimoroni.com
that come with it, all leading up to thepihut.com
building your own robot, and once coolcomponents.co.uk
again a lot of the parts can also be
used with a regular Raspberry Pi for
bigger projects.

ELECTRONICS KITS
STARTER KIT FOR
RASPBERRY PI PICO
PRICE £10 / URL magpi.cc/starterpico

Pico is a fantastic board for learning electronics,


and this kit comes with some basic components
to get you started with lighting LEDs. It can also
FIYWIH[MXL7EWTFIVV]5M[MXLHMǺIVIRXNYQTIV
cables. It also comes with a Pico H – a Pico with a
GPIO header attached.
GROVEPI+ STARTER KIT
PRICE £110 / URL magpi.cc/groveplus

STORAGE SOLUTIONS If you want to get stuck in with


some home automation and
Electronic components can
be small but they also tend other IoT projects, this kit is
to come in resealable bags a great way to start. The
– for some, putting them in special GrovePi+ connects
a drawer in their bags is good on top of Raspberry Pi and
enough, but storage boxes has connectors to several
can make organising many included modules, which
components much easier. can be programmed in
The one in the photo can be
Python and C.
found at magpi.cc/compbox.

Complete Raspberry Pi Buyer’s Guide magpi.cc 37


ROBOTS, ROBOTS,
ROBOTS Make an automaton with
a Raspberry Pi or Pico

CAMJAM EDUKIT 3 MONSTERBORG


PRICE £20 / URL magpi.cc/edukit3 PRICE £210 / URL magpi.cc/monsterborg

Probably the greatest


This is our go-to recommendation
wheeled robot for
for a robot kit for beginners – it’s
makers, this stylish
low cost and easy to program, and
masterpiece from
the coding and components can be
the folks at PiBorg
used in future, bigger robot projects.
was used in the Formula Pi
It works with just about every kind of
VEGMRKWIVMIWERHMWEFPIXSǼMT
Raspberry Pi (and probably with Raspberry
over and drive upside down like the
Pi Pico if you’re a bit more experienced)
classic Tyco Rebound RC car from the nineties.
and there are a few 3D printable chassis for
Powerful and easy to program, it includes the
it if you’d rather not use the cardboard box it
fantastic ThunderBorg robot controller which
GSQIWcMREWMXWJVEQI
can be used for this and other robot projects, as
well as the ability to make use of a Raspberry Pi
camera module for computer vision/machine
AUTONOMOUS ROBOTICS learning tasks when in automated mode. It’s also

PLATFORM FOR PICO very sturdy.

PRICE £41 / URL magpi.cc/autorobot


XGO-LITE ROBOT DOG
If you have a Raspberry Pi Pico and you’re
interested in robotics, you can’t go far wrong PRICE £484 / URL magpi.cc/cm4xgo
with this kit from Kitronik. It’s a little easier
to assemble than most, requiring 8LMWǻZIPMQFIHVSFSXHSKMWEZIV]TS[IVJYPTMIGISJOMXEFPIXS
no soldering, and has room walk along on four of those limbs and having great articulation
for growth with extra [MXLXLIǻJXLXSTMGOYTSFNIGXWEMHIHF]MXWGEQIVEERH
components. computer vision.
Like a lot of It also has machine-learning
Raspberry Pi Pico powered face and expression
projects, tutorials recognition so it will react to
and examples are in you with cute animations on its
MicroPython so they’re WGVIIRcERHGERFITVSKVEQQIH
easy to pick up and in Python and Blockly remotely for
customise by rookie coders excellent automation.

38 magpi.cc Complete Raspberry Pi Buyer’s Guide


3D PRINTING
Level your projects up by making your own parts

CHOOSE A RASPBERRY PI
3D PRINTER
With so many 3D printers to choose
MERCH!
from, its best to ask the experts, which in >SZbZʬdZ`]WZaPQZ]=L^[MP]]d;T
our mind is our colleagues on our sibling bT_SZʯNTLWXP]NSLYOT^P
publication HackSpaceQEKE^MRI
Issue 59 (hsmag.cc/59) has a guide on
building an open source 3D printer, as
Enamel pin
well as reviews of 3D printers throughout
its other issues, such as the new Prusa PRICE £4
MK4 in issue 67 (hsmag.cc/67). URL magpi.cc/pin

FIND 3D PRINTS Mug


There’s an absolutely PRICE £9
massive community of 3D URL magpi.cc/mug
TVMRXIVWWLEVMRKXLIMVǻPIWSR
the internet, and mostly for
free! If you have an idea for a
part or print in general, you
should look on Thingiverse Badges
(thingiverse.com) or PRICE £6
Printables (printables.com). URL magpi.cc/badges
;IƶZIEPWSWIIRǻPIWSR*XW]JSVWEPISJKVIEX
items, so don’t forget to look around for prints.

Water bottle
MAKE YOUR OWN PRICE £18

3D PRINTS URL magpi.cc/bottle

.J]SYGERƶXǻRH[LEX]SYRIIH+VII(&)
(freecad.org) is online software that helps
you create 3D objects that can be used in
printing, and its very easy to use, especially
for simpler projects like cases.

Complete Raspberry Pi Buyer’s Guide magpi.cc 39


2024

200 PAGES OF RASPBERRY PI


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

Everything you need to Learn robotics with our


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

Inspiring projects for your Play retro games with the


next build idea diminutive Raspberry Pi Pico

Buy online: magpi.cc/handbook


* Raspberry Pi hardware not included
TUTORIAL

Overclock
Raspberry Pi 5
Take the already speedy Raspberry Pi 5 all
the way up to 3.0GHz. By Lucy Hattersley

B
dOPQL`W_=L^[MP]]d;T ZʬP]^LS`RP But more speed is what we’re after here, so we
speed increase over previous models. heavily suggest using a cooling device, such as
Lucy Having said that, more is always a bonus _SP,N_TaP.ZZWP]Z]ZʯNTLW=L^[MP]]d;T.L^PQZ]
MAKER

Hattersley and it’s possible – if not always desirable, or Raspberry Pi 5. These devices contain fans which
necessary – to push the speed pedal a little harder. will keep the temperature down and the speed up.
Lucy is editor of The With some Raspberry Pi devices, you can make ?SLYV^RZZ`__Z5Pʬ2PP]WTYRbSZ^PbZ]V
MagPi magazine the clock speeds run even faster, a process known predated ours (XLR[TNNUPʬZaP]WZNV) and forms
and enjoys
computers and her as “overclocking”. the basis for the NZYʭR_c_ code in this tutorial.
cat. Overclocking Overclocking Raspberry Pi 5 via Raspberry Pi Let’s put the pedal to the metal!
the cat is probably OS isn’t dangerous, but it isn’t supported either
a bad idea though.
(and not all Raspberry Pi 5 boards respond to
Probably?
overclocking, see “YMMV”).
magpi.cc
Edit config
Overclocking causes Raspberry Pi 5 to use more
power, and the board will consequently run a lot
01 Set up a fresh installation of Raspberry Pi 5
hotter. This isn’t dangerous because Raspberry OS. Be prepared for some experimentation here so
Pi OS will throttle performance to bring the heat don’t use an SD card with anything on it you don’t
levels down. mind losing. If you have an Active Cooler or case

The config.txtǻPI
is edited to adjust
(59cGPSGOERH,59
core speeds

You’ll Need
> Raspberry Pi 5
magpi.cc/
raspberrypi5
> Raspberry Pi OS
(Bookworm)
magpi.cc/software
> Active Cooler
or Fan Case
recommended
magpi.cc/
activecooler

42 magpi.cc Overclock Raspberry Pi 5


TUTORIAL

Inside Raspberry Pi 5 sits a Broadcom


'(2UYEHGSVI&VQ(SVXI\&
processor running at 2.4GHz. Which
we’re going to take up to 3.0GHz

Warning!
Crash likely!
Experimenting with
overclocking may crash
Raspberry Pi OS. There
You can overclock Raspberry
with a fan is also a chance of
Pi 5 without cooling, but it corrupting the microSD
now is the time card. Experiment with
will quickly throttle down to
_ZʭcT_-ZZ_TY_Z a clean Raspberry Pi
protect the CPU negating OS installation and
Raspberry Pi OS. XLIIǺIGX8LI&GXMZI(SSPIV IRWYVIcRSMQTSVXERX
Our instructions to will keep it running fast
data is at risk.

overclock Raspberry Pi 5 live QEKTMGGSZIVGPSGO


in the NZYʭR_c_ʭWP?ST^T_^PWQ
lives inside the /boot/ directory. Open
L_P]XTYLWbTYOZbLYOPOT__ST^ʭWPbT_S
the following command Underclock Top Tip
$ sudo nano /boot/config.txt An interesting aspect of over_voltage_delta is that YMMV
it’s a signed value. This means you can use negative
>N]ZWWOZbY_Z_SPPYOZQ_SPʭWPLYOWZNL_P numbers to use less power (and have less speed). Your mileage will
[all]. We’re going to add code beneath here. This could have interesting applications in projects vary and there
that use solar, or battery power. is an overclock
Use this code in GSRǻKX\X to take the power lottery. The
ĬåƴåĬƤÚŅƵĹ× stock speeds of
2400Mhz and
Increase voltage
02 ?SPʭ]^_^_P[T^_ZTYN]PL^P_SPaZW_LRP
[all]
# Decrease the voltage
800Mhz are what
all Raspberry
amount. In previous Raspberry Pi models. over_voltage_delta=-10000 Pi 5 models
can operate at.
For previous iterations of Raspberry Pi we
Some units will
recommended using over_voltage, but now # Set Arm core frequency in MHz
overclock better
the Raspberry Pi engineers recommend over_ (default 2400) than others. If
voltage_delta (XLR[TNNZaOPW_L). This is because arm_freq=2200 Raspberry Pi
Raspberry Pi 4, 400 and now 5 use a feature called OS behaves
DVFS (Dynamic Voltage and Frequency Scaling, You can use this command in a Terminal window erratically or
ƋŅƴĜåƵƋĘåÏƚųųåĹƋŞŅƵåųÏŅĹŸƚĵŞƋĜŅĹ× freezes, reduce
magpi.cc/dvfs). This technique allows Raspberry Pi
the amounts or
4 and 5 devices to run at lower temperatures while $ vcgencmd measure_volts core
stop overclocking
still providing the same performance. altogether.
According to Raspberry Pi’s documentation:

Overclock Raspberry Pi 5 magpi.cc 43


TUTORIAL

M`_WP_ɪ^_]d^XLWWP]aLW`P^ʭ]^_,OO_SP^PWTYP^
Recover from crash below the over_voltage_delta line:

# Set Arm core frequency in MHz (default


In this tutorial we are slowly increasing the CPU and GPU speed. On many
Raspberry Pi 5 boards (including ours) this will eventually result in a crash. Typically,
2400)
Raspberry Pi OS will freeze. arm_freq=2600
‰ĘåÏʱĬĬåĹčåĘåųåĜŸƋʱƋƼŅƚϱĹĹŅƋåÚĜƋÏŅĹĀčţƋƻƋĜűŸŞÆåųųƼ{Ĝk„ƋŅ
ÚåÏų屟åƋĘå{ŽŸŞååÚţ‰Ęå屟ĜåŸƋƵ±ƼƋŅĀƻƋĘĜŸĜŸƋŅŞŅƵåųŅý±ŸŞÆåųųƼ{ĜĂ Restart Raspberry Pi OS. Click the Raspberry Pi
±ĹÚųåĵŅƴåƋĘåĵĜÏųŅ„%ϱųÚţcåƻƋØĜĹŸåųƋƋĘåĵĜÏųŅ„%ϱųÚĜĹƋŅ±ĹŅƋĘåųÏŅĵŞƚƋåųţ logo and choose Shutdown, then Reboot. Or enter
kŞåĹƋĘåĵĜÏųŅ„%ϱųÚÚųĜƴåĜĹƋĘå8ĜĬåŸx8ĜĹÚåųx)ƻŞĬŅųåų±ŞŞ±ĹÚĬŅϱƋåƋĘå
sudo reboot in a terminal window.
ÏŅĹĀčţƋƻƋĀĬåŅĹƋĘåųŅŅƋŅüƋĘåÚųĜƴåţkŞåĹƋĘåĀĬåĜűƋåƻƋåÚĜƋŅų±ĹÚ±ÚģƚŸƋØŅų
Now test out Raspberry Pi OS for a few minutes
remove, the overclock values back to the point where Raspberry Pi 5 booted. Place
the microSD card back in Raspberry Pi 5 and boot up again. to ensure that it remains operating properly
without freezing up. Open a web browser and
browse a few sites to check everything is running.
If Raspberry Pi OS freezes you will need to remove
the overclock commands from NZYʭR_c_ (see the
“Recover from crash” boxout).

Speed test
04 If Raspberry Pi OS runs without crashing
take a look at the increased speed in action. To
check the new maximum clock speed open a
terminal window and enter:

$ sudo cat /sys/devices/system/cpu/cpu0/


cpufreq/cpuinfo_max_freq

In use, the core frequency will adjust between


8LIGSRǻKX\XǻPIMW “Various clocks (e.g. ARM, Core, V3D, ISP, the maximum speed and a slower frequency (to
being edited on a
PC laptop running H264, HEVC) inside the SoC are monitored reduce energy consumption). To view the actual
Ubuntu to restore Md_SP ʭ]XbL]PLYObSPYPaP]_SPdL]PYZ_ speed enter this command:
the values to a point
where Raspberry running at full speed, the voltage supplied to
5Mc[MPPFSSXERH the particular part of the chip driven by the $ vcgencmd measure_clock arm
VYRcGSVVIGXP]
clock is reduced relative to the reduction from
Q`WW^[PPO 4YPʬPN_ ZYWdPYZ`RSaZW_LRPT^ This will return the value that the Arm CPU is
supplied to keep the block running correctly at running at × 1,000. To monitor the clock in real
_SP^[PNTʭN ^[PPOL_ bSTNST_T^]`YYTYR?ST^ time enter this command:
NLY ]P^`W_TY^TRYTʭNLY_]PO`N_TZY^TY[ZbP]
used by the SoC, and therefore in the overall heat $ watch -n 1 vcgencmd measure_clock arm
being produced.”
Add the following code to the NZYʭR_c_ʭWP Fire up the web browser and visit youtube.com.
underneath [all]: Open up a video and you will see the clock speed
spin up. After a while it may reduce back down as
# Increase the voltage _SP,]XNST[XLYLRP^T_^^[PPOPʯNTPY_Wd:[PY
over_voltage_delta=50000 another window and run another video to spin up
the speed.

Increase frequency
03 Take it further
Now we are going to increase the frequency
of the CPU from its core speed of 2400MHz.
05 Now we’re going to take the Arm clock
Eventually we plan to take this up to 3000MHz, up to the maximum we have found reliable on

44 magpi.cc Overclock Raspberry Pi 5


TUTORIAL

our test devices, 3MHz. Open a Terminal window have maxed out at 3000 and 900 for our CPU and Using a Terminal
command to
and enter nano /boot/conºg.txt to edit the 2;@]P^[PN_TaPWd QSRMXSVcGPSGO
NZYʭR`]L_TZYʭWP^% Overclocking does use more power than speeds while running
YouTube videos
running at the standard speed. And, we can’t
# Set Arm core frequency in MHz (default ^_]P^^ PYZ`RS_SL__SP]PR`WL]23eLYO
2400) #83e NWZNV^[PPO^QZ]_SP.;@LYO2;@L]P
arm_freq=3000 XZ]P_SLY^`ʯNTPY_QZ]LWW_SP_L^V^bPɪaP`^PO
Raspberry Pi for. So this is more of a novelty
Again, reboot Raspberry Pi OS and check that to play around with for us. Perhaps of more
everything is running correctly. Repeat Step 4 to use would be underclocking Raspberry Pi 5 for
test the speed. If your Raspberry Pi crashes follow projects that demand less power, and need to
the “Recover from crash” boxout and reduce the make the most use of battery power (see our
speed to 2800. Some Raspberry Pi boards are more “Underclocking” boxout).
amenable to overclocking than others (see the
“YMMV” boxout).

config.txt DOWNLOAD
THE FULL CODE:
GPU frequency
06 :`]YPc_^_P[T^_ZTYN]PL^P_SP2;@
> Language: Bash magpi.cc/github
frequency. By default, this is 800Mhz, and we have
successfully increased this to 900MHz on our test 001. # Increase the voltage
Raspberry Pi boards. Edit NZYʭR_c_ and add: 002. over_voltage_delta=50000
003.
# Set GPU frequency in MHz (default 800) 004. # Set Arm core frequency in MHz (default 2400)
gpu_freq=900 005. arm_freq=3000
006
Reboot and test Raspberry Pi OS by launching 007. # Set GPI frequency in MHz (default 800)
a web browser and testing YouTube. Some users 008. gpu_freq=900
have reported that gpu_freq=1000 also works on
their devices, so feel free to test that out. But we

Overclock Raspberry Pi 5 magpi.cc 45


TUTORIAL

Cloud Gaming with


Raspberry Pi 5
Play the latest AAA console games with only a Raspberry Pi 5 and
a good internet connection. No downloads, no updates. Here’s how

D
id you know your Raspberry Pi can also included. We’ll also cover other options such as
double as an Xbox or a high-end gaming Nvidia GeForce Now. Sadly, Sony’s PlayStation
PC? You can now play the latest games in equivalent is PC-only, and we encountered issues
PJ Evans
MAKER

full HD using just your humble credit-card-sized using Amazon’s Luna. Xbox and Nvidia can work
PJ is a writer, computer. Your inputs (controller, keyboard) are with Raspberry Pi as they both support streaming
software engineer sent to the remote ‘rig’ and a video stream of the to the browser, including Chromium.
and tinkerer. He game is sent back. Recent improvements mean
really enjoyed
XLIcXIWXMRKTLEWI lag is barely perceivable and the video quality is
of this article. excellent. It’s not quite as easy as powering up
Choose your hardware
mastodon.
social/@mrpjevans
and jumping into Baldur’s Gate III, however, and
you’ll need to make a few decisions along the
02 A good controller is essential for any
way. This tutorial will walk you through it all. gaming, cloud or otherwise. We’ve chosen the
8BitDo Pro 2. Not only is it a great Bluetooth
controller, but it’s also proven with Raspberry Pi
hardware and approved by Xbox. You can also use
Choose your platform
01 There are a handful of cloud gaming
LYZʯNTLWCMZcNZY_]ZWWP]TQdZ`[]PQP]DZ`ɪWWLW^Z
need to interact with a keyboard and mouse. Of
services available. Out of all of them we’ve chosen course, you can use a regular wired keyboard and
Xbox Game Pass Ultimate as a great service for mouse connected to the USB ports, but if you’re
our Raspberry Pi 5. For a monthly subscription, setting up a gaming environment you may want to
you can access hundreds of games that are consider a wireless keyboard such as the Logitech
instantly playable, and many top games are K400 series which combines a keyboard and
trackpad in one.

Initial setup
03 We’re going to need the ‘full’ version
of Raspberry Pi OS, complete with desktop, as
You’ll Need we need the Chromium web browser. Using the
Raspberry Pi Imager (magpi.cc/imager) select
> Fast internet Raspberry Pi OS (64-bit) and write the image
connection
MHIEPP]ǻFVI
to your SD card to get the latest evolution of
the operating system. We strongly recommend
> 8BitDo Pro
using a wired internet connection to your Raspberry
2 controller
magpi.cc/pro2 Pi if possible, for best results, but if you’re using
Wi-Fi, set it up now (and SSH too if you need
> Wireless
remote access). Once booted and ready to go, check
OI]FSEVHQSYWI
magpi.cc/k400 and install any software updates (or run sudo apt
8LI'MX)S5VSGSRXVSPPIVMWETIVJIGXGLSMGIJSVXLMW
TVSNIGXERHMWIRHSVWIHF]2MGVSWSJXJSV<FS\,EQIW5EWW update && sudo apt upgrade in the Terminal).

46 magpi.cc Cloud Gaming with Raspberry Pi 5


TUTORIAL

=SYƶPPRIIHXSYWIXLIOI]FSEVHERHQSYWIEW[IPPEWE Thanks to HDMI, you


KEQIGSRXVSPPIVWSGLSSWIE[MVIPIWWSTXMSRPMOIXLIWI can do your gaming
on the big screen
Set up your controllers With cloud gaming our
04 The keyboard (with built-in trackpad)
favourite diminutive
computer can hold its own
we have chosen is very simple to set up because
against bigger machines
it uses a dedicated USB dongle. Just plug in the
receiver, and make sure the keyboard has some
batteries and is switched on. Both it and the
trackpad should work immediately. Bluetooth
devices, such as our controller, need to be paired
ʭ]^_.WTNVZY_SP-W`P_ZZ_STNZYL__SP_Z[]TRS_
of the screen and select ‘Add Device’. When the
scanning window appears, put your controller
into pairing mode (on the Pro 2, press Start + X
then press the sync button for a few seconds). The
Sign up for Game Pass Ultimate
device should appear in the window. Now click
‘Pair’ to connect. You only have to do this once.
06 Xbox’s Game Pass service comes with Top Tip
OTʬP]PY__TP]^ZQLNNP^^.WZ`ORLXTYRT^ZYWd
provided with the Ultimate package, which at Choose the
Recent improvements time of writing is £12.99 per month with a £1 right mode
ZʬP]QZ]_SPʭ]^_XZY_S1Z]dZ`]XZYPddZ`RP_
mean lag is barely full access to over 300 games, from classics like Using the 8BitDo
Pro 2? Always
perceivable and Fortnite and GTA, indie greats like A Short Hike
and newer top titles such as >_L]ʭPWO and Football
begin by pressing
the X + Start
the video quality Manager 2024. Sign up will require credit card
details which will be debited monthly. You can
buttons to ensure
maximum Xbox
is excellent cancel your subscription at any time. Get yourself compatibility.
signed up and then you’re ready to start gaming.

Get an account
05 Try it out
It is a necessity of cloud gaming that you
have an account with the provider. In Xbox’s case,
07 Open up Chromium on your Desktop and
this is Microsoft. So if you haven’t got one, now is go to xbox.com. If you haven’t already, log in
a good time to get yourself set up with a Microsoft now. When you are returned to the front page,
ID. Go to xbox.com, click ‘Sign in’ then ‘Create click ‘Games’ then ‘Cloud games’. You’ll have
account’. Go through the steps to get set up, and a selection of games chosen for you, or you can
don’t forget to choose a strong password and scroll to the bottom and click ‘See all games’.
multi-factor authentication. Now you can log into Choose a game and then click ‘Play’. You may get
xbox.com and get ready to start gaming. a warning that a controller has not been detected.

Cloud Gaming with Raspberry Pi 5 magpi.cc 47


TUTORIAL

=SYƶPPRIIHXSWMKRYT
JSV<FS\,EQIW5EWW
9PXMQEXI.XGSQIW
with access to over
KEQIW

Troubleshooting
If so, click A on your controller and it should clear.
If that doesn’t work, check your pairing. You’ll
09 9ZbdZ`bTWWʭYOZ`_bSP_SP]dZ`]^P_`[
YZbMP[`_TYL\`P`PQZ]_SPʭ]^_LaLTWLMWP]TR has a good enough connection. The service will
try to adjust video quality, prioritising speed
ZaP]]P^ZW`_TZY4QdZ`ʭYOT_TYLOP\`L_P_]d
moving from Wi-Fi to a wired connection. Check
Playtime!
08 Your wait time will depend on the game’s
whether your sibling is streaming HD video while
`[WZLOTYR ^PWʭP^4QYZ_STYRbZ]V^NZY_LN_
requirements and popularity. In our testing, most your internet provider to see if there are any faster
games kept you waiting no more than a couple Z[_TZY^LaLTWLMWP_ZdZ`BPɪaPQZ`YO_SL_ʭM]P
of minutes, but popular and resource-hungry based services are the only way to get close to a
games can see waits of 30 minutes or more at ]PLWNZY^ZWPPc[P]TPYNP4QdZ`ɪ]PʭYOTYR]P^[ZY^P
peak times. If this happens, try choosing another times laggy, nearby radio interference may be the
game. The wait screen will keep you informed of cause, and using an Ethernet cable to connect to
progress. When the game starts, it will be as if dZ`]]Z`_P]NLYʭc_ST^_ZZ
you were in front of a real console and you play
4YVI\TIVMIRGI
WXVIEQMRKKEQIW accordingly. Pressing the 8BitDo controller’s
[MXL1YRE[EWRƶX
‘heart’ button will bring up an overlay so you can
KSSHFYXMXQMKLX
Boot straight in
[SVOJSV]SY end the game or adjust settings.
10 ?ZʭYP^^PdZ`]CMZcPc[P]TPYNPbPNLY
NZYʭR`]P=L^[MP]]d;T:>^ZdZ`NLYMZZ_^_]LTRS_
into a full-screen browser. Open up a Terminal
window or SSH into your tiny gaming rig. Now
issue this command:

nano ~/.config/wayfire.ini

2Z_Z_SPMZ__ZXZQ_SPʭWPLYOLOO_ST^L^L
single line:

[autostart]
chromium = chromium-browser https://www.
xbox.com/en-GB/play?xr=shellnav/ --kiosk

48 magpi.cc Cloud Gaming with Raspberry Pi 5


TUTORIAL

3ZMHMEƶW,I+SVGI
--noerrdialogs --disable-infobars --no-first-
run --ozone-platform=wayland
The service will try to 3S[TPEXJSVQGSQIW
[MXLWSQIKVIEX
HIQSWJSVJVIIWYGL

>LaP_SPʭWPLYO\`T_9LYZCTRL+X). Reboot,
adjust video quality, as Lego Bricktales

and Chromium will start in fullscreen mode prioritising speed


automatically, and go straight to the Xbox
home page. over resolution
Other platforms
12 We also tried Amazon Luna, which is a
Nvidia GeForce Now
11 If you want to try cloud gaming completely
^TXTWL]ZʬP]TYR_Z9aTOTLɪ^3ZbPaP]LW_SZ`RS
streaming worked well, we found it struggled
for free, check out Nvidia GeForce Now, a similar with controller input, with seemingly random
service to Xbox Game Pass. It has a free tier that keypresses ruining the gaming experience. We Top Tip
allows you to access a small subset of games, were unable to establish whether this was a
including an excellent demo of Lego Bricktales. It temporary glitch, however, so do try Luna if Steam Link
runs in the browser just like Xbox’s service, but you have Prime membership. If you’re looking at
can link in with popular game libraries such as a permanent gaming setup, don’t forget that If you want to
Epic and Steam to allow access to your purchased cloud-based streaming is not your only option. play your PC
games (if supported). You can also choose a Raspberry Pi is a brilliant platform for retro games in another
room, check out
paid tier to get access to the games libraries and gaming (check out RetroPie) or even having a go at
Steam Link for
better hardware. Visit magpi.cc/geforcenow to making your own with Python PyGame. Whichever Raspberry Pi.
check it out. way you go, have fun!

Cloud Gaming with Raspberry Pi 5 magpi.cc 49


TUTORIAL

Python on
Raspberry Pi
There’s been a major change to Python. Now is a great time
to learn about virtual environments. By Alasdair Allan

R
aspberry Pi OS Bookworm brings a big 1]ZX-ZZVbZ]XZYbL]O^[LNVLRP^TY^_LWWPO
change for Python users, as we implement aTL[T[X`^_MPTY^_LWWPOTY_ZL;d_SZYAT]_`LW
Alasdair a change introduced by the Python 0YaT]ZYXPY_`^TYRaPYamagpi.cc/venv?ST^
MAKER

Allan community in upstream Debian: from Bookworm SL^MPPYTY_]ZO`NPOMd_SP;d_SZYNZXX`YT_d


onwards, packages installed via pip must be YZ_ =L^[MP]]d;T^PP;0;!!#QZ]XZ]POP_LTW^
Alasdair Allan installed into a Python Virtual Environment. This magpi.cc/pep668
is a scientist,
bTWWLʬPN_LWZ_ZQ[PZ[WPLYObP`YOP]^_LYOT_bTWW 4Y^_LWWTYR[LNVLRP^`^TYRL[_T^_SP[]PQP]]PO
author, hacker
and journalist. In MPOT^]`[_TaPQZ]XLYdL^bPLWWRP_`^PO_Z_SPYPb XP_SZOQZ]TY^_LWWTYR;d_SZYWTM]L]TP^ZY=L^[MP]]d
the past he has bLdZQOZTYR_STYR^ ;T:>-ZZVbZ]X;LNVLRP^TY^_LWWPOaTLL[_L]P
mesh networked 4Y_ST^_`_Z]TLWbP_LVPLWZZVL_bSL_SL^ _P^_PO`^`LWWd[]PNZX[TWPO^Z_SPdTY^_LWWQL^_P]
the Moscone
Center, caused a
NSLYRPOLYOSZb_ZPʬPN_TaPWd`^P;d_SZYZY LYOL]POP^TRYPOQZ]=L^[MP]]d;T:>?SPdbZYɪ_
US Senate hearing, =L^[MP]]d;T:> -ZZVbZ]X M]PLVdZ`]^d^_PX,OOT_TZYLWWdTY^_LWWTYRaTL_ST^
and contributed ;d_SZYT^TY^_LWWPOMdOPQL`W_ZY=L^[MP]]d ]Z`_PXPLY^_SL_LWW]P\`T]POOP[PYOPYNTP^L]PLW^Z
to the detection of
;T:>LYOT^`^POQZ]XLYdTX[Z]_LY_Q`YN_TZY^ TY^_LWWPOLYOLWZRZQTY^_LWWL_TZYT^XLTY_LTYPOMd
what was – at the
time – the most 4Y_P]QP]TYRbT_S_SP^d^_PX;d_SZYTY^_LWWL_TZY _SP:>^Z_SPTY^_LWWL_TZYNLYMPPL^TWd]ZWWPOMLNV
distant object NLY_SP]PQZ]PNL`^P[]ZMWPX^QZ]dZ`]Z[P]L_TYR `YTY^_LWWPOTQYPPOPO
]IXcHMWGSZIVIHMR ^d^_PX^ZT_ɪ^TX[Z]_LY__SL_TQdZ`TY^_LWW_ST]O 1Z]TY^_LYNP_ZTY^_LWW_SP;d_SZYWTM]L]d_Z
XLI9RMZIVWI
[L]_d;d_SZYWTM]L]TP^dZ``^P_SPNZ]]PN_[LNVLRP ^`[[Z]_Z`]-`TWO3,?%
magpi.cc/docs XLYLRPXPY__ZZW^
?SP]PL]P_bZ]Z`_P^_ZTY^_LWWTYRWTM]L]TP^TY_Z $ sudo apt install python3-build-hat
_SPOPQL`W_[d_SZYOT^_]TM`_TZY1T]^_WddZ`NLY`^P
L[_LYOTY^_LWW[]PNZYʭR`]PO^d^_PX[LNVLRP^Z] ɳ_ZTY^_LWW_SP[]PM`TW_WTM]L]d
LW_P]YL_TaPWddZ`NLY`^P[T[_ZTY^_LWW[LNVLRP^_SL_ @^TYRL[_XLVP^TY^_LWWTYRWL]RP][LNVLRP^
L]PYZ_OT^_]TM`_POL^[L]_ZQ=L^[MP]]d;T:> WTVPY`X[dbSTNSSL^XLYdYL_TaPOP[PYOPYNTP^
TYNW`OTYRL1Z]_]LYNZX[TWP]X`NS^TX[WP]_SLY
TY^_LWWTYRTYOTaTO`LW[LNVLRP^`^TYR;d_SZYɪ^ZbY
[LNVLRPXLYLRPXPY_^d^_PX
4QdZ`bLY__ZTY^_LWWL;d_SZYWTM]L]dNLWWPO
ɭY`X[dɮdZ`NLY`^Papt search foobar_Z^PL]NS
QZ]_SPPcLN_[LNVLRPYLXP4YXZ^_NL^P^dZ`ɪWW
ʭYO_SL__SP]P\`T]PO[LNVLRPT^RZTYR_ZMPNLWWPO
[d_SZYQZZML]Z][d_SZYQZZML]

Virtual environments
4Y[]PaTZ`^aP]^TZY^ZQ_SPZ[P]L_TYR^d^_PXdZ`
`^PO_ZMPLMWP_ZOT]PN_WdTY^_LWWWTM]L]TP^^d^_PX
bTOP`^TYR_SP[LNVLRPTY^_LWWP]QZ];d_SZY
NZXXZYWdVYZbYL^[T[DZ`ɪWWʭYO_SPQZWWZbTYR
4RGIMREZMVXYEPIRZMVSRQIRX]SYGERMRWXEPP
Python packages in Thonny using the Package ^Z]_ZQNZXXLYOTYXLYd_`_Z]TLW^ZYWTYP%

50 magpi.cc Python on Raspberry Pi


TUTORIAL

Click New virtual environment Packages must now be


in Thonny to switch the Python installed into a Python
executable to a virtual space virtual environment

$ pip install buildhat

3ZbPaP]TYYPbP]aP]^TZY^ZQ=L^[MP]]d;T:>
LYOZ_SP]Z[P]L_TYR^d^_PX^_ST^T^OT^LWWZbPO4Q
dZ`_]dLYOTY^_LWWL;d_SZY[LNVLRP^d^_PXbTOP
dZ`ɪWW]PNPTaPLYP]]Z]^TXTWL]_Z_ST^%

$ pip install buildhat


error: externally-managed-environment

× This environment is externally managed


ͻʴ To install Python packages system-wideř
try apt install
python3-xyzř where xyz is the package you
are trying to ]T^VZQM]PLVTYRdZ`];d_SZYTY^_LWWL_TZYZ]:>Md Installing the
buildhat package
install. [L^^TYR--break-system-packages>PP;0;!!#QZ] inside a Python
_SPOP_LTWPO^[PNTʭNL_TZY ZMVXYEPIRZMVSRQIRX
allows the package
If you wish to install a non-Debian- ?ST^P]]Z]T^RPYP]L_POMPNL`^PdZ`ɪ]P_]dTYR and its dependencies
to be added
packaged Python packageř _ZTY^_LWWL_ST]O[L]_d[LNVLRPTY_Z_SP^d^_PX
create a virtual environment using python3 ;d_SZY ,WZYR^_LYOTYR[]LN_TNLW[]ZMWPXQZ]
-m venv path/to/venv. ;d_SZY`^P]^SL^MPPYNZYʮTN_^MP_bPPY:>[LNVLRP
Then use path/to/venv/bin/python and path/ XLYLRP]^WTVPL[_LYO;d_SZY^[PNTʭN[LNVLRP
to/venv/bin/pip. Make XLYLRPXPY__ZZW^WTVP[T[?SP^PNZYʮTN_^TYNW`OP
sure you have python3-full installed. MZ_S;d_SZYWPaPW,;4TYNZX[L_TMTWT_TP^LYONZYʮTN_^
ZaP]ʭWPZbYP]^ST[
For more information visit http://rptl.io/ ?SP]PQZ]PQ]ZX-ZZVbZ]XZYbL]O^[LNVLRP^ You’ll Need
venv TY^_LWWPOaTL[T[X`^_MPTY^_LWWPOTY_ZL;d_SZY
AT]_`LW0YaT]ZYXPY_`^TYRvenv,aT]_`LW > Raspberry Pi
9Z_P_SL_TQdZ`MPWTPaP_ST^T^LXT^_LVPdZ` PYaT]ZYXPY_T^LNZY_LTYP]bSP]PdZ`NLY^LQPWd
> Raspberry Pi OS
^SZ`WONZY_LN_dZ`];d_SZYTY^_LWWL_TZYZ]:> TY^_LWW_ST]O[L]_dXZO`WP^^Z_SPdbZYɪ_TY_P]QP]P (Bookworm)
OT^_]TM`_TZY[]ZaTOP]DZ`NLYZaP]]TOP_ST^L__SP bT_SZ]M]PLVdZ`]^d^_PX;d_SZY

Python on Raspberry Pi magpi.cc 51


TUTORIAL

aP]^TZYZQ;d_SZY_SPZYPdZ`ɪ]PN`]]PY_Wd`^TYRdZ`
^SZ`WO_d[P%

$ source env/bin/activate
(env) $

ɳLYOdZ`ɪWW^PP_SL_dZ`][]ZX[_T^YZb
[]P[PYOPObT_SPYa_ZTYOTNL_P_SL_dZ`ɪ]PYZ
WZYRP]`^TYR_SP^d^_PX;d_SZY4Y^_PLOdZ`ɪ]P
`^TYR_SPaP]^TZYZQ;d_SZYNZY_LTYPOTY^TOPdZ`]
aT]_`LWPYaT]ZYXPY_,YdNSLYRP^dZ`XLVPSP]PZ]
(VIEXMRKEZMVXYEP
IRZMVSRQIRXMRXLI
Using pip with venv XZO`WP^dZ`TY^_LWWTY_ZdZ`]PYaT]ZYXPY_bZYɪ_
command line ?Z`^PLaT]_`LWPYaT]ZYXPY__SPʭ]^__STYRdZ` NL`^P[]ZMWPX^QZ]dZ`]^d^_PX;d_SZY
YPPO_ZOZT^_ZN]PL_PLNZY_LTYP]_Z^_Z]P_SP
PYaT]ZYXPY_?SP]PL]P^PaP]LWbLd^dZ`NLYOZ_ST^ (env) $ which python
OP[PYOTYRZYSZbdZ`bLY__ZbZ]VbT_S;d_SZY
Top Tip
/home/pi/my_proŒect/env/bin/python
:YPbLddZ`NLY[]ZNPPOT^_ZN]PL_PLYPb
aT]_`LW PYaT]ZYXPY_LW^ZVYZbYL^ɭaPYaɮQZ] 4QbPRZLSPLOLYOTY^_LWWL_ST]O[L]_d[LNVLRP
System Python PLNS;d_SZY[]ZUPN_dZ`XLVP3P]PdZ`ɪWWN]PL_P T_ɪWWYZbTY^_LWWTY_Z_SP;d_SZYOT^_]TM`_TZYTYZ`]
LOT]PN_Z]d_ZSZWOdZ`]NZOPLWZYRbT_SLaT]_`LW aT]_`LWPYaT]ZYXPY_
If you want PYaT]ZYXPY_OT]PN_Z]d%
to inherit the
(env) $ pip install buildhat
currently installed
$ mkdir my_proŒect ooking in indexes: https://pypi.org/simpleř
packages from
the system $ cd my_proŒect https://www.piwheels.org/simple
Python you should $ python -m venv env Collecting buildhat
create your virtual Downloading https://www.piwheels.org/
environment TQdZ`YZbWZZVTY^TOP_SPXdJ[]ZUPN_OT]PN_Z]d simple/buildhat/buildhat-0.5.12-py3-none-any.
using python dZ`ɪWW^PPLOT]PN_Z]dNLWWPOPYa whl (57 kB)
-m venv –––––––––––––––––––––––––––––––––––––
--system-site- $ ls -la 57.8/57.8 kB 2.8 MB/s eta 0:00:00
packages env. total 12 Collecting gpiozero
drwxr-xr-x 3 pi pi 4096 ct 3 14:34 . Downloading https://www.piwheels.org/
drwx------ 20 pi pi 4096 ct 3 14:34 .. simple/gpiozero/gpiozero-2.0-py3-none-any.whl
drwxr-xr-x 5 pi pi 4096 ct 3 14:34 env (150 kB)
Trying to use pip to $ –––––––––––––––––––––––––––––––––––––
install buildhat in
the default Python 150.5/150.5 kB 6.9 MB/s eta 0:00:00
IRZMVSRQIRXRS[
4Y^TOP_ST^OT]PN_Z]dT^LQ`WW;d_SZYOT^_]TM`_TZY Collecting pyserial
causes an error
message to show ?ZLN_TaL_PdZ`]aT]_`LWPYaT]ZYXPY_LYOXLVP_SL_ Downloading https://www.piwheels.org/
simple/pyserial/pyserial-3.5-py2.py3-none-any.
whl (90 kB)
–––––––––––––––––––––––––––––––––––––
90.6/90.6 kB 7.5 MB/s eta 0:00:00
Collecting colorzero
Downloading https://www.piwheels.org/
simple/colorzero/colorzero-2.0-py2.py3-none-
any.whl (26 kB)
Requirement already satisfied: setuptools
in ./env/lib/python3.11/site-packages (from
colorzero-ʴgpiozero-ʴbuildhat) (66.1.1)
Installing collected packages: pyserialř
colorzeroř gpiozeroř buildhat
Successfully installed buildhat-0.5.12
colorzero-2.0 gpiozero-2.0 pyserial-3.5
(env) $

52 magpi.cc Python on Raspberry Pi


TUTORIAL

ɳLYOTQdZ`pip listdZ`ɪWW^PP_SL_dZ`]N`]]PY_
aP]^TZYZQ;d_SZYSL^dZ`]YPbXZO`WP^% Using Thonny editor
(env) $ pip list Thonny is our recommended IDE (integrated
Package ersion development environment) when working with
---------- ------- Python on Raspberry Pi. By default, Thonny uses
buildhat 0.5.12 ƋĘåƤŸƼŸƋåĵ{ƼƋĘŅĹţ
colorzero 2.0 However, you can switch to using a Python
ƴĜųƋƚ±ĬƤåĹƴĜųŅĹĵåĹƋÆƼÏĬĜÏĩĜĹčŅĹƋĘåĜĹƋåųŞųåƋåų
gpiozero 2.0
menu located at the bottom right of the Thonny
pip 23.0.1
ƵĜĹÚŅƵţĬĜÏĩĜĹčŅĹƋĘĜŸƵĜĬĬŅýåųƼŅƚ±ĵåĹƚƋŅ
pyserial 3.5 ŸåĬåÏƋ±ÏŅĹĀčƚųåÚĜĹƋåųŞųåƋåųŅųƋŅŅĹĀčƚųå
setuptools 66.1.1 ±ĹƤĜĹƋåųŞųåƋåųţ
ĘŅŅŸåŅĹĀčƚųåĜĹƋåųŞųåƋåų±ĹÚÏĬĜÏĩůcåƵ
,Q_P]b]T_TYRdZ`]NZOPdZ`NLY]`YT_Q]ZX_SP virtual environment’. An alert window will appear
NZXXLYOWTYPTY^TOP_SPaT]_`LWPYaT]ZYXPY_L^ ƋʱƋŸ±ƼŸŮeüƋåųÏĬĜÏĩĜĹčůkUűƼŅƚĹååÚƋŅÏĘŅŅŸå±Ĺ
empty directory, which will be the root of your new
dZ`ɪOPc[PN_MdTYaZVTYR;d_SZYL^YZ]XLW
virtual environment”.
ĬĜÏĩkU±ĹÚÏĘŅŅŸåů%ŅÏƚĵåĹƋŸűĜĹƋĘåŸĜÚåƱų
(env) $ ls -la ŅųƤƋĘå8ĜĬåŸ±ŞŞţĬĜÏĩůųå±Ƌå8ŅĬÚåųű±ĹÚåĹƋåų
total 12 ŮĵƼƣŞųŅģåÏƋ۱ŸƋĘåüŅĬÚåųűĵå±ĹÚÏĬĜÏĩkUţ
drwxr-xr-x 3 pi pi 4096 ct 3 14:34 . œ±ĜƋüŅųƋĘåůųå±ƋĜĹčƴĜųƋƚ±ĬåĹƴĜųŅĹĵåĹƋűƵĜĹÚŅƵ
drwx------ 20 pi pi 4096 ct 3 14:34 .. to appear, and close. Check that the Python
executable selection contains “my_project/bin/
drwxr-xr-x 5 pi pi 4096 ct 3 14:34 env
ŞƼƋĘŅĹƐ۱ĹÚÏĬĜÏĩkUţ
-rw-r--r-- 1 pi pi 0 ct 3 14:45 my_ You can now install packages into your virtual
code.py machine using Tools > Manage packages. If you
(env) $ python my_code.py ϱĹĹŅƋŸåå‰ŅŅĬŸƋĘåĹĀųŸƋÏĬĜÏĩŅĹů„ƵĜƋÏĘƋŅ
Hello World! regular mode’ and restart Thonny.
(env) $ „å±ųÏĘüŅųůÆƚĜĬÚʱƋűĜĹƋĘåa±Ĺ±čåޱÏĩ±čåŸ
ƵĜĹÚŅƵ±ĹÚÏĬĜÏĩůÆƚĜĬÚʱƋűĜĹƋĘåŸå±ųÏĘųåŸƚĬƋŸ
ƵĜĹÚŅƵţĬĜÏĩůĜĹŸƋ±ĬĬűƋŅ±ÚÚƋĘåޱÏĩ±čåƋŅƼŅƚų
DZ`NLYWPLaPdZ`]aT]_`LWPYaT]ZYXPY_LYO]P_`]Y
virtual environment.
_Z`^TYR_SP^d^_PX;d_SZYMd_d[TYR%

(env) $ deactivate
$

ɳLYO[]ZaP_ZdZ`]^PWQdZ`ɪaPOZYP^ZMd
NSPNVTYR_SPTY^_LWWPO[LNVLRP^`^TYRpip list
DZ`ɪWW^PP_SP]PT^LNZY^TOP]LMWPOTʬP]PYNP

User environments
,YLW_P]YL_TaPXP_SZO_ZN]PL_TYRLaT]_`LW
PYaT]ZYXPY_QZ]PLNSZQdZ`];d_SZY[]ZUPN_^T^_Z BPNLYLRLTYNSPNVbPɪ]PTYL^P[L]L_P
N]PL_PL^TYRWPaT]_`LWPYaT]ZYXPY_QZ]dZ`]`^P] PYaT]ZYXPY_Md`^TYRpip list%
LNNZ`Y_LYO_SPYLN_TaL_P_SL_PYaT]ZYXPY_MPQZ]P
]`YYTYRLYdZQdZ`];d_SZYNZOP?ST^L[[]ZLNS (.env) $ pip list
XLd MP[]PQP]]POTQdZ`NZXXZYWdTY^_LWW_SP Package ersion
^LXP^P_ZQXZO`WP^QZ]PLNS[]ZUPN_LYOOZYɪ_ ---------- -------
bLY__ZSLaP_ZMZ_SP]N]PL_TYRTYOTaTO`LW;d_SZY pip 23.0.1
PYaT]ZYXPY_^QZ]PLNS[]ZUPN_P^^PY_TLWWdU`^_ setuptools 66.1.1
O`[WTNL_TYRdZ`]PYaT]ZYXPY_
ɳLYOWPLaPT_`^TYRdeactivate
$ python -m venv ~/.env
$ source ~/.env/bin/activate (.env) $ deactivate
(.env) $ $

Python on Raspberry Pi magpi.cc 53


TUTORIAL

Remote control
Raspberry Pi with VNC
Use TigerVNC to remotely access the latest and
greatest version of Raspberry Pi OS desktop

A
s is so often the case in computing, a
new version of an operating system
brings advancements but also some
PJ Evans
MAKER

compatibility headaches.?SPZWOCbTYOZb
PJ is a writer, system that is the underlying engine of the
software engineer Raspberry Pi desktop has grown too restrictive, so
and tinkerer. He Raspberry Pi OS Bookworm has moved to the new
once pranked a
colleague by using whizzy Wayland engine. Wayland is a great and
VNC to randomly necessary step forward, but If you want to remote
change his desktop control your desktop using VNC, you need to
image. You should
move to a service that understands Wayland and a
not do this.
NWTPY__SL_ɪ^NZX[L_TMWP,YO_SL_ɪ^?TRP]A9.>Z
mastodon.
social/@ here’s how it’s done. Here we enable VNC using the Desktop app. Just slide the
switch to the right and click OK

window, click the Interfaces tab and select VNC.


Let’s get ready to remote!
01 ?SPWL_P^_=L^[MP]]d;T:>`^P^_SPYPbP]
Now click OK and within a couple of seconds,
your VNC server will be running. You won’t see
Wayland subsystem to manage the desktop (as LYd_STYROTʬP]PY_ZY_SP^N]PPYT_ɪ^LWWTY_SP
Z[[Z^PO_Z_SPZWOR`L]OCNZX[L_TMTWT_d background.
with many VNC servers has (for now) been lost.
Luckily, Raspberry Pi OS Bookworm ships with
a working service, WayVNC, installed and ready
Help! I’ve got no head!
to go. So, start by using Raspberry Pi Imager to
install Raspberry Pi OS and make sure you’ve
03 If you are setting up a headless Raspberry
got all the usual networking up and running. Pi (one that has no display attached), you can still
Finally, update everything by checking the System enable VNC remotely. Using a terminal app on your
Updates app or using apt update && sudo apt local computer, SSH into the Raspberry Pi (you’ll
upgrade in the terminal. need to know its IP address or hostname) then run
sudo raspi-conºg_Z^_L]__SP.ZYʭR`]L_TZY?ZZW
Use the cursor key to select Interface Options, select
You’ll Need VNC and press ENTER. On the next screen use TAB
Enable VNC
> Raspberry Pi
02 ?SP]PL]P_bZbLd^_ZPYLMWPdZ`]BLdA9.
to select Yes, press ENTER again and the server will
be enabled. You then can go back to the main menu
server, which will allow you to connect to the LYO^PWPN_1TYT^S?SP]Pɪ^YZYPPO_Z]PMZZ_
> Raspberry Pi OS
Bookworm =L^[MP]]d;T]PXZ_PWd?SPʭ]^_LYOPL^TP^_
method is to use the desktop. Log in locally and
> Computer with
click on the Raspberry Pi logo to bring up the
TigerVNC Viewer
A local app for local people
tigervnc.org menu. Now go down to Preferences and select
=L^[MP]]d;T.ZYʭR`]L_TZY:Y_SP]P^`W_TYR
04 Just as much as we need something to VNC

54 magpi.cc Remote control Raspberry Pi with VNC


TUTORIAL

The TigerVNC Viewer is


freely available for Raspberry
Pi OS, macOS, Windows and
many Linux distributions

Control your Raspberry Pi


from anywhere, as if you
were sitting right in front of it

to, we need something to VNC from. We now turn The TigerVNC UI is


easy to use. Enter
our attention to the remote computer. WayVNC, the IP address or
Raspberry Pi’s VNC server, has some particular hostname (normally
followed by ‘.local’)
security requirements that reduce the number of ERHGPMGOc(SRRIGX
clients with which it is compatible. We’ve seen the
MP^_]P^`W_^bT_S?TRP]A9.bSTNST^ML^POZY_SP
[Z[`WL]?TRS_A9.DZ`NLYRP__SP?TRP]A9.NWTPY_
for free from tigervnc.org although on a Raspberry
Pi you can install it by searching for tigervnc-
aTPbP]TY,OO=PXZaP>ZQ_bL]PTY?P]XTYLWMd LNNP[_TYRLVPd?SP^PL]PYZ_STYR_ZbZ]]dLMZ`_
running sudo apt install tigervnc-viewer. just some of the advanced security we discussed.
Go ahead and say OK to both prompts. Finally,
enter your username and password (the same
You should now see as you use for login). You should now see your

your Raspberry Pi’s Raspberry Pi’s desktop in all its glory.

desktop in all its glory Top Tip


Remote access
Get yourself connected 06 What’s in a
05 ?TXP_Z_]dT_Z`_ >_L]_`[?TRP]A9.,
You will now be able to control your
Raspberry Pi as if you were sitting in front of name
small connection box will appear. Enter the IP it. You can even cut and paste across the two
Here we are
address or hostname of the Raspberry Pi followed machines. Don’t expect a perfect frame rate, as the using TigerVNC
MdɭWZNLWɮdZ`NLYʭYO_SPSZ^_YLXP`^TYR networking will introduce lag. If you’re interested as the client,
SZ^_YLXPTY_SP?P]XTYLW:]PY_P]hostname in accessing the desktop outside of your network, not the popular
-I to get the IP address. Unlike many VNC ]PXPXMP]^PN`]T_d^SZ`WOMPʭ]XWdL__SPQ]ZY_ZQ TightVNC. Tiger
NWTPY_^dZ`OZYZ_[`_ɭ%ɮZ]^TXTWL]LQ_P]_SP your mind. You’ll need to use your router to assign is an evolution of
TightVNC, which
LOO]P^^?SL_bTWWNL`^PLYP]]Z].WTNV.ZYYPN_ your Raspberry Pi a static IP address and some
does not yet work
You may be alarmed to see a warning about a method of VPN access (such as PiVPN Wireguard) with Bookworm.
^P]aP]NP]_TʭNL_PZ]LWL]RPOTLWZR`PL^VTYRLMZ`_ for security access to your network.

Remote control Raspberry Pi with VNC magpi.cc 55


TUTORIAL

Using Ubuntu
Part 02

on Raspberry Pi
Exploring more features of the Ubuntu
Desktop Linux OS on Raspberry Pi

I
Y_SPʭ]^_[L]_ZQ_ST^_`_Z]TLW^P]TP^XLR[T and get under the hood of the operating system.
NN bP^SZbPOSZb_ZTY^_LWWLYO^P_`[ We’ll be using it to perform various tasks.
Phil _SP@M`Y_`OP^V_Z[Z[P]L_TYR^d^_PXZYL To open a Terminal window in Ubuntu, click the
MAKER

King =L^[MP]]d;TLYO_ZZVdZ`_S]Z`RS^ZXPZQT_^ Activities button at the top of the left sidebar and
VPdQPL_`]P^ search for ‘Terminal’, then double-click the icon to
A long-time This time we’ll look at how to access the launch it. Alternatively, use the keyboard shortcut:
contributor to The command line, set up remote connections via SSH CTRL+ALT+T.
MagPi, Phil is a
freelance writer and and RDP, install media codecs, use Raspberry Pi’s The terminal window will show the usual
editor with a focus GPIO pins, change the desktop environment, and command-line prompt where you can enter a
on technology. use alternative ways of installing software. host of commands. To see the path for the current
@philkingeditor working directory (i.e. the folder you’re in), enter
pwd. To list its contents, enter ls. You can use the
cd command to change directory; for example,
Access the command line
01 As well as navigating Ubuntu’s desktop
cd Downloads.
For lots more useful commands, check out the
GUI, you can open a CLI (command-line interface) command-line tutorial in The MagPi issue 125
Terminal to use powerful text-based commands (XLR[TNN ).

You’ll Need
> Raspberry Pi 4,
400, or 5

> 16GB (or greater)


microSD card with
Ubuntu Desktop
23.10 installed

After installing
Ubuntu-restricted-
extras, you can
TPE]c25ZMHISW
MRcEcQIHMETPE]IV
such as VLC

56 magpi.cc Using Ubuntu on Raspberry Pi


TUTORIAL

The CLI terminal is


used to enter text-
based commands

The Dock shows favourite This sliding tile


apps and any others that game was installed
are running from a DEB package

02 Install media codecs Since Ubuntu (like Raspberry Pi


As a pure FOSS (free open-source software)
operating system, Ubuntu doesn’t come with OS) is based on Debian Linux,
common non-free codecs pre-installed. So, if you
L__PX[__Z[WLdLXPOTLʭWP^`NSL^LY8;X`^TN you can also install software
track or MP4 video, you may see a message to
_SL_PʬPN_
from DEB files
7`NVTWd_SP]Pɪ^LYPL^dʭcL^dZ`NLYTY^_LWW
Install DEB files
a single package – called ubuntu-restricted-
extras – to install all the essential media codecs.
03 Since Ubuntu (like Raspberry Pi OS) is based
To do so, open a Terminal window and enter the on Debian Linux, you can also install software from
following command: /0-ʭWP^?ZʭYO[LNVLRP^^`T_LMWPQZ]=L^[MP]]d
Pi, head to [LNVLRP^OPMTLYZ]Rstable and look for
$ sudo apt install ubuntu-restricted-extras any labelled ‘arm64’ or ‘all’.
?ZTY^_LWWLOZbYWZLOPO/0-ʭWP_SP]PL]P_bZ
You’ll be prompted to enter your Ubuntu user main ways. You can use the Terminal command
password. A list of packages to be installed will sudo dpkg -iQZWWZbPOMd_SPʭWPYLXPLYO[L_STQ
then be shown; press ENTER_ZNZYʭ]XDZ`ɪWW
_SPYYPPO_ZNZYʭ]X_SP0@7,[]P^^TAB to
not in the same directory). For instance, to install
the 2048 Qt game:
Top Tip
highlight ‘OK’, then press ENTER). Press TAB to
Desktop icons
highlight the options, then ENTER on ‘Yes’ to $ sudo dpkg -i 2048-qt_0.1.6+b1_arm64.deb
accept the terms. You should now be able to play When switching
ʭWP^bT_S_SZ^P]P^_]TN_PONZOPN^ If you get messages about missing dependencies, back to the
If you also want to play DVDs via a USB-attached follow this up with: default desktop
environment, it
O]TaPdZ`ɪWWYPPO_ZTY^_LWWWTMOaO]PLO0Y_P]_ST^
may retain the
Terminal command: $ sudo apt -f install.
icon settings etc.
from the previous
$ sudo /usr/share/doc/libdvdread4/install- ɳ_ZTY^_LWW_SPX,W_P]YL_TaPWd_ZZ[PY/0- one. Revert them
css.sh ʭWP^^_]LTRS_Q]ZX_SPOP^V_Z[dZ`NLYTY^_LWW_SP in the Tweaks app.
Gdebi tool using this command:

Using Ubuntu on Raspberry Pi magpi.cc 57


TUTORIAL

Connect via SSH


05 Sometimes you may need to operate your
Raspberry Pi from another computer or device,
such as when it isn’t plugged into a monitor. SSH
(Secure Shell) is a tried and tested method for
gaining secure remote access to the command line.
Unlike in Raspberry Pi OS, there’s no all-in-
ZYP=L^[MP]]d;TNZYʭR`]L_TZY_ZZWQZ]PYLMWTYR
interfaces and protocols in Ubuntu. Nor can you
enable SSH in advance using Raspberry Pi Imager’s
advanced settings. So you’ll need to do it manually.
It’s best to run a sudo apt updateʭ]^_?SPY_Z
Once the OpenSSH
WIVZIVMWMRWXEPPIH $ sudo apt install gdebi install the required OpenSSH server, use:
a Remote Login
option will appear in
Settings > Sharing ?SPYbSPYdZ`OZ`MWPNWTNVL/0-ʭWPdZ`NLY $ sudo apt install openssh-server
then select Gdebi to open it and install the package.
0Y_P]dZ`][L^^bZ]O:YNPT_ɪ^TY^_LWWPOZ[PY_SP
Settings app (search for it in the Show Apps tool or
Activities) and select Sharing > Remote Login. Turn
Other ways to install
04 Instead of browsing the (newly renamed in
on the switch to enable SSH connections.
You should be able to connect remotely from
@M`Y_`@M`Y_`,[[.PY_P]dZ`NLY`^P_SP another computer, using:
snap install command followed by a package name
if you prefer. $ ssh [username]@[computer_name.local]
As on Raspberry Pi OS, the Apt package manager
can be used to install certain packages. To search Or with its IP address:
for available ones, use apt-cache search followed
by the search term (or just ‘.’ to list all packages). $ ssh [username]@[IP address]
Then install one with sudo apt install followed by
the package name. For instance, ssh phil@phil-desktop.local or
There’s also the option of using the Flatpak ssh phil@192.168.1.880Y_P]dZ`][L^^bZ]O
utility to install an app and run it in a virtual and you should be taken to Raspberry Pi’s
The GNOME Tweaks environment. Refer to XLR[TNNʮL_[LV][Tfor command line.
tool lets you further
customise the instructions for how to install Flatpak and the
appearance and
Flathub repository, then download and install apps
FILEZMSYVSJ]SYV
Ubuntu system from the latter (ʮL_S`MZ]R).
Remote desktop
06 Since SSH is limited to entering text-based
Terminal commands remotely, if you want to access
_SPOP^V_Z[dZ`ɪWWYPPO_Z`^PLOTʬP]PY_XP_SZO
Normally we’d use VNC, but this can be a little
tricky to get working for Ubuntu on Raspberry Pi.
Luckily, Ubuntu has a built-in remote desktop
sharing facility using RDP (Remote Desktop
Protocol). Open the Settings app and select Sharing
> Remote Desktop. Then turn both switches on,
for Remote Desktop and Remote Control (so you
can navigate remotely, not merely view). In the
Authentication section, you can view the current
password and change it if you want.
To connect from another computer, you’ll
need a suitable client such as Microsoft Remote
Desktop, Thincast, or Remmina. Use the ‘Device
Name’ shown in Ubuntu’s Remote Desktop window

58 magpi.cc Using Ubuntu on Raspberry Pi


TUTORIAL

appended with ‘.local’, or use its IP address. Then


enter your username and the Remote Desktop
[L^^bZ]O4RYZ]PLYdbL]YTYR^_SL__SPNP]_TʭNL_P
NZ`WOYɪ_MPaP]TʭPOLYONZY_TY`P
You should then be able to view Raspberry Pi’s
Ubuntu desktop on the remote machine. Note the
sharing icon that appears in the top taskbar; click it
when you want to close the remote connection.

Change the look


07 In Settings > Appearance, you can switch to
dark mode and change the background image, while
Settings > Ubuntu Desktop has options for desktop
icon size/position, the Dock (left sidebar), and
tiling. You can do more customisation by installing Log Out. Click your username, then the gear icon at You can switch to
EHMǺIVIRXHIWOXST
the gnome-tweaks tool: _SPMZ__ZX]TRS_ZQ_SPWZRTY^N]PPY_Z^PWPN_L/0 IRZMVSRQIRXWYGL
from the menu. as KDE Plasma

$ sudo apt install gnome-tweaks -dOPQL`W__SP]Pɪ^ZYWdLNSZTNPZQ_bZ/0^%


Ubuntu (the default) and Ubuntu on Xorg (which
Opening the Tweaks app will enable you to alter switches the display manager from Wayland to
the appearance of the cursor, icons, fonts and other X11). You can install extra environments from the
settings. You can add more options from custom command line, however. For example:
_SPXP^MdTY^_LWWTYR_SP0c_PY^TZY8LYLRP]%
$ sudo apt install kde-plasma-desktop
$ sudo apt gnome-shell-extension-manager
You should then be able to select it – Plasma
:[PY_SP0c_PY^TZY8LYLRP]L[[NWTNV_SP C TY_ST^NL^PɧQ]ZX_SPWZRTY^N]PPY/0
Browse tab, then User Themes and Install. In the selection menu.
web browser, download a theme or icons from
RYZXPWZZVZ]R^`NSL^:]NST^0c_]LN__SPʭWP
OZ`MWPNWTNVTY_SPʭWPM]Zb^P]
Coding with Python
In Terminal, create two new directories (for
2?629:80>SPWWLYOTNZYN`]^Z]ML^PO_SPXP^
09 You can still use Raspberry Pi’s GPIO
respectively) in your home folder: pins in Ubuntu, but you’ll need to install a new
Python module:
$ mkdir ~/.themes
$ mkdir ~/.icons $ sudo apt install python3-lgpio

In the Files browser, press CTRL+H to show You can then import it like any other Python Top Tip
STOOPYʭWP^QZWOP]^9ZbXZaP_SPPc_]LN_PO_SPXP module at the top of your code, with import
folder(s) into the relevant folder, such as .themes lgpio. You can write programs in Ubuntu with a IP address
for Orchis. Reopen the Tweaks app, and you should _Pc_POT_Z]^`NSL^YLYZZ]L;d_SZY4/0^`NSL^
now see new options in the Shell and Legacy Apps Spyder: sudo apt install spyder. To obtain
drop-downs. You may get a system prompt to For details of the lgpio module’s functionality, Raspberry Pi’s
install missing snaps; click ‘Yes’. see XLR[TNNWR[TZ. For some code examples, visit IP address, to
XLR[TNNWR[TZPcLX[WP^. The ‘basic GPIO example’ connect from
bTWWMWTYVLY70/NZYYPN_PO_Z2;4:LYOL29/ another device via
pin. Paste it into a new document, named blink. SSH or Remote
Switch desktop environments
08 DZ`NLYPaPY^bT_NS_ZLOTʬP]PY_OP^V_Z[
py, using Nano (or another text editor), then run it
bT_S_SPNZXXLYO[d_SZYblink.py. Alternatively,
Desktop, enter
the command
PYaT]ZYXPY_/0Q]ZX_SP`^P]WZRTY^N]PPYɧ_Z dZ`NLYTY^_LWWL;d_SZY4/0^`NSL^>[dOP]ɧsudo hostname -I.
get back there, click the top-right power icon and apt install spyder – and run it from there.

Using Ubuntu on Raspberry Pi magpi.cc 59


TUTORIAL

Raspberry Pi:
Part 02

Mecanum robot
with sensors
Expanding on our mecanum robot project, add a distance
sensor to avoid crashing into obstacles. Learn how
collision avoidance is used to make driving safer

T
he mecanum robot in the earlier tutorial taken between the signal being transmitted and
Stewart
MAKER

(MagPi issue #135, magpi.cc/135) could be the response received can be used to work out
Watkiss
controlled with a gamepad. If you didn’t the distance to an object.
Also known as react fast enough, then it was quite easy to crash Figure 1 shows the HC-SR04 sensor used for
Penguin Tutor. A the robot. Adding an ultrasonic distance sensor _ST^[]ZUPN_?SP]PL]POTʬP]PY_XZOPW^ZQ_SP
Maker and YouTuber
means that the robot can automatically stop HC-SR04, some of which can work down to 3.3V.
who loves all things
Raspberry Pi. Author before colliding with a wall or other object. This circuit is based around the 5V version for
of Learn Electronics The sensor used is similar to those found in car maximum compatibility.
with Raspberry Pi. parking sensors. The robot senses the distance to
penguintutor. objects in front and automatically stops forward
com movement when an object is too close. With
Sensor signals
@stewartwatkiss additional code, this could be used as the basis of
a robot that could navigate a maze.
02 In addition to the power supply, the
HC-SR04 semsor module has two pins for an
input and output signal. The trigger needs to be
You’ll Need sent a short 10μS pulse to start the measurement.
Ultrasonic distance sensors
> HC-SR04 Ultrasonic 01 ?SP]PL]PaL]TZ`^OTʬP]PY_^PY^Z]^_SL_
The transmitter then sends eight sonic bursts and
the reciever listens for an echo.
distance sensor
can be used to detect distance. The one used here After determining how long it took to receive
magpi.cc/hcsr04
is based on ultrasonic distance measurement, a response at the receiver, the echo pin is then
> 330 ohm resistor and works by emitting an ultrasound signal and raised high for a length of time proportional
magpi.cc/330r
then listening for an echo response. The time to the distance. This is shown in Figure 2.
> 470 ohm resistor The output from the echo pin is 5V, which is
magpi.cc/470r too high for the GPIO pins. Therefore a resistor
voltage divider can be used to drop the signal to
approximately 3.3V.

Wiring the distance sensor


Figure 1. The HC-
SR04 module has 03 The distance sensor needs a 5V power
a transmitter and
receiver. It sends out supply. As the robot can have up to 6V, this is
ultrasonic pulses connected after the diode used to connect to the
and detects an
IGLScVIWTSRWI 5V pin on your Raspberry Pi.

60 magpi.cc Raspberry Pi: Mecanum robot with sensors


TUTORIAL

An ultrasonic distance
sensor is used to detect
the distance of objects
in front of the robot

A resistor voltage divider


is used to protect the GPIO
pins from the 5V signal

The distance sensor needs to be connected V x (R2 / (R1+R2))


to two GPIO ports. The chosen pins are GPIO
5 (physical pin 29) for the trigger, and GPIO 6 … which is approximately 3V. This is the signal
(physical pin 31) for the echo. that is passed to GPIO 6.
The trigger pin works with a 3.3V input signal
so is connected directly to the GPIO pin. To drop
the echo signal from 5V to 3.3V you need two
Using PiGPIO
resistors. If using USB for power then there is not
much space for these, but they can be squeezed
05 GPIO Zero is used to control the motor
into the gap between the USB connector and the driver and can also be used for the ultrasonic
motor drivers as shown in Figure 3. ^PY^Z]@^TYRT_^OPQL`W_YL_TaP[TYNZYʭR`]L_TZY
GPIO Zero can communicate with most sensors
Figure 2. Waveforms
with acceptable performance. For the ultrasonic showing signals
used to trigger the
ultrasonic sensor
Resistor voltage divider
04 The breadboard diagram shows the
and the received
distance signal

resistors with long leads, which are needed to


RP_ _SPX_Zʭ_TY_Z^`NSL_TRS_^[LNP?ST^
XLVP^ T_OTʯN`W__Z^PPSZbT_T^bT]PO^Z_SP
schematic diagram of the voltage diagram is
also shown in Figure 4.
The output is from pin 3 of the HC-SR04, which
goes through a voltage divider created by R1 and
R2. The voltage is shared across these resistors
proportional to their resistance. The voltage
across R2 will be:

Raspberry Pi: Mecanum robot with sensors magpi.cc 61


TUTORIAL

dist_sensor.distance

The returned value is in meters. The maximum


distance set in the code is 0.09, which works out
as 9cm.

Using Pygame Zero


08 The earlier version of the robot software
was written as a command-line Python program.
One issue with that is that the code would stop
Figure 3. Wiring running whilst waiting for the next key press.
diagram with the This means it is not possible to check for a
resistor voltage
divider squeezed in potential collision whilst the robot is moving.
between the motor
An alternative is to use Pygame Zero, which
driver and the USB
power connector can create a GUI application which can respond
to keyboard presses as well as regularly checking
sensor the timing is critical, and using the native the value from the distance sensor. It also
library can give incorrect results. Instead, you provides a way to create a graphical screen
can use PiGPIO. This allows direct memory access which can be controlled using a mouse or
(DMA), which reduces the requirement on the touchscreen. A screenshot is included in
[]ZNP^^Z]?Z`^P;T2;4:_SP;T2;4:OLPXZYʭ]^_ Figure 5.
needs to be run as root, and then the appropriate
pin_factory needs to be set in your Python
program. The daemon is started using
How to code for Pygame Zero
sudo pigpiod
09 ?SPXLTYOTʬP]PYNPbT_S;dRLXPEP]ZT^
that instead of running the program in sequence
the code is event-driven. The main way that
code is run is through two functions draw() and
update() which are each called approximately
Using Python Pin Factory
06 With the pigpiod daemon running, then
60 times per second (depending upon computer
performance). The draw() function is used for
the device factory can be set within the Python displaying the interface on the screen and the
code. First, you need to import the PiGPIOFactory update() function normally handles any other
library from gpiozero.pins.pigpio import code that needs to be run.
PiGPIOFactory. Then set the pin_factory using: It is also possible to set code that runs when an
event occurs which in this example is the on_key_
Device.pin_factory = PiGPIOFactory()
Figure 4. Schematic diagram showing the wiring between the
GPIO pins and the ultrasonic sensor. The two resistors form a
This will then use PiGPIO for all devices that voltage divider reducing the voltage
use the GPIO pins from GPIO Zero.

Measuring the distance


07 ?ZXPL^`]P_SPOT^_LYNPʭ]^_N]PL_PL
DistanceSensor object:

dist_sensor = DistanceSensor(echo=6,
trigger=5)

The distance can then be queried by looking at


the distance property:

62 magpi.cc Raspberry Pi: Mecanum robot with sensors


TUTORIAL

down(key) function which is called each time that


a key is pressed on the keyboard.

The update function


10 The collision avoidance code is included
in the update function. The code detects if the
distance is less than the minimum distance. If
it is then it also checks that the robot is going
forward, otherwise you would end up with a robot
that couldn’t reverse either. included on the module PCB to allow mounting, Figure 5. A very
basic GUI display
The code includes error handling by placing but due to their small size compared to the has been created
checks for the sensor inside a try block. If the resolution of the 3D printer these were not used, using Pygame Zero.
This allows the
code in the try block has an exception, then and the board can be held with a small amount of sensor code to run
regularly to check for
instead of crashing the program it will ignore tape or adhesive putty. The bracket is shown in a possible collision
the rest of that block and call the except block Figure 6/ZbYWZLO_SPM]LNVP_OP^TRYʭWPQ]ZX
instead. In this case, if the sensor isn’t detected, magpi.cc/robotmecanum.
then it prints out an error message. 1Z]LOTʬP]PY_NSL^^T^T_XLdMP[Z^^TMWP
to drill holes for the sensor or make your own
bracket using thick cardboard.

Running the code


11 To run the code then it needs to be run
using pgzrun. This can be done using Pygame
Zero mode in the Thonny editor, or by running on
the command line using:

pgzrun mecanum-pgz.py

The program can still be used with


AntiMicroX to allow the robot to be controlled
using a gamepad.
If you get an error, then make sure you started
[TR[TZOʭ]^_L^XPY_TZYPOPL]WTP]

Mounting the sensor


12 Finally, you will need somewhere to mount
the sensor. If you are using the 3D-printed
chassis then there are mounting holes included
for a printable bracket. There are small holes

Figure 6. The bracket is designed to screw to the front of the


chassis to mount the ultrasonic sensor
TUTORIAL

DOWNLOAD
mecanum-pgz.py THE FULL CODE:
magpi.cc/mecanumrobotgit
> Language: Python Pygame Zero

001. # Minimal version of mecanum-pgz 049. keys.K_6 : (1, -1, -1, 1), # Right
002. from gpiozero.pins.pigpio import PiGPIOFactory 050. keys.KP6 : (1, -1, -1, 1), # Right
003. from gpiozero import Device, PWMOutputDevice, 051. keys.K_8 : (1, 1, 1, 1), # Forwards
004. Motor, DistanceSensor 052. keys.KP8 : (1, 1, 1, 1), # Forwards
005. 053. }
006. WIDTH=800 054.
007. HEIGHT=600 055. # Track direction
008. 056. current_direction = (0, 0, 0, 0)
009. Device.pin_factory = PiGPIOFactory() 057.
010. 058. # speed is as a percentage (ie. 100 = top speed)
011. pwm_pin = 18 059. speed = 50
012. m_f_l = (2,3) 060. pwm_out.value = speed/100
013. m_f_r = (22,23) 061.
014. m_r_l = (14,15) 062. def draw():
015. m_r_r = (24,25) 063. screen.ºll((192,192,192))
016. 064. for arrow in arrows:
017. motors = [ 065. arrow.draw()
018. Motor(m_f_l[0], m_f_l[1], pwm=False), 066.
019. Motor(m_f_r[0], m_f_r[1], pwm=False), 067. def update():
020. Motor(m_r_l[0], m_r_l[1], pwm=False), 068. global current_direction
021. Motor(m_r_r[0], m_r_r[1], pwm=False) 069. try:
022. ] 070. if (dist_sensor.distance <= min_distance):
023. 071. # Is robot going forward (or diagonal)
024. pwm_out = PWMOutputDevice (pwm_pin) 072. if (current_direction[0] == 1 and
025. dist_sensor = DistanceSensor(echo=6, trigger=5) current_direction[1] == 1):
026. 073. print (“Warning - crash imminent”)
027. arrows = [ 074. # Force stop using stop key number
028. Actor(“arrow.png”, center=(500,300)), # Right (5)
029. Actor(“arrow.png”, center=(400,200)), # Up 075. set_direction (direction[keys.K_5])
030. Actor(“arrow.png”, center=(300,300)), # Left 076. except:
031. Actor(“arrow.png”, center=(400,400)) # Down 077. print (“No distance sensor detected”)
032. ] 078.
033. arrows[1].angle = 90 079. def on_key_down(key):
034. arrows[2].angle = 180 080. global speed, current_direction
035. arrows[3].angle = 270 081. # Get next key pressed
036. 082. if (key in direction.keys()) :
037. # distance in meters - a value between 0 and 1 083. set_direction(direction[key])
038. min_distance = 0.09 084.
039. 085. def set_direction(direction):
040. # list to convert key into motor on/off values to 086. global current_direction
correspond with direction 087. current_direction = direction
041. # direction based on number keypad 088. for i in range (0, 4):
042. direction = { 089. if direction[i] == -1:
043. keys.K_2 : (-1, -1, -1, -1), # Backwards 090. motors[i].backward()
044. keys.KP2 : (-1, -1, -1, -1), # Backwards 091. elif direction[i] == 1:
045. keys.K_4 : (-1, 1, 1, -1), # Left 092. motors[i].forward()
046. keys.KP4 : (-1, 1, 1, -1), # Left 093. else:
047. keys.K_5 : (0, 0, 0, 0), # Stop 094. motors[i].stop()
048. keys.KP5 : (0, 0, 0, 0), # Stop 095.

64 magpi.cc Raspberry Pi: Mecanum robot with sensors


Sɟ͝ʡʄ˱

H́Ɏɟ

H́˱ɿʡʄͽ̿ɟ

˱ǵˍΰφɟ

P RO FES S I O N A L CO N T RO L SYS T E M D E V E LO P M E N T TOO L

Home projects made easy.


CDP Studio, a great software development tool for your home projects. Build
͝ΰͮ͝ɟ˪͝‫ڂ‬ɿ́̿‫ڂ‬żǵ̵͝Ȼɟ̿̿ΰ‫ڂ‬Ŵʡհ‫͝ͽڂ‬ɟ‫ڂ‬H֕֕‫ڂ̿́ڂ‬ĩ́H́Ɏɟ‫̵́̿ڂ‬ʄ̿ǵ˪˪ʡ˱ʄհ‫̵́ڂ‬ɟ˱‫̿ͽ́͝ڂ‬ɂɟ‫ˍڂ‬ʡȻ̿ǵ̿ʡɟ͝հ‫ڂ‬
out of the box support for GPIO, I2C, MQTT, OPC UA and more. Create beautiful user
interfaces. Built for industrial control system development, FREE for home projects.

cdpstudio.com
Ɨɟˍմ‫ڂ‬ֈԊԎ‫ڂ‬ԐԐԅ‫ڂ‬ԏԅ‫ڂ‬Ԑԅԅ‫ڂ‬՘‫ڂ‬ʡ˱ɿ́ԺɂɎ̵ͮɟɂʎձɂ́˪
HSŴ‫ڂ‬Ɨɟɂʎ˱́ˍ́ʄʡɟ͝‫ڂ‬Ɖ‫ڂ‬ՄՄ‫˱ͽ ڂ‬Ɏ͝ΞȘ̿ʄǵͮǵ‫ڂ‬ԏհ‫ڂ‬ԍԅԅԏ‫ˍڂ‬ɟ͝ͽ˱Ɏհ‫ڂ‬ĩ́̿΢ǵΰ
With the release of Raspberry Pi 5,
we’re introducing two new official
hardware solutions for cooling.

By Alasdair Allan

E
very time a new Raspberry Pi is released,
there are questions about thermal control
of the new board. People want to know
whether it’s necessary, and if so, what you’ll need
to do to make it happen.
For normal usage of your Raspberry Pi, adding
cooling is entirely optional. The idle performance of
a Raspberry Pi 4 and a Raspberry Pi 5 is about the
same, and under typical loads, Raspberry Pi 5 will
run cooler than a similarly loaded Raspberry Pi 4.
However, a heavy continuous load will mean that the
board could potentially go into thermal throttling.
Throttling happens as there are software controls to
limit CPU speeds if things get start to get too toasty.
Although, even when fully throttled, a Raspberry Pi 5
is still going to run faster than a Raspberry Pi 4.
But data makes everything better, so I decided to
grab some early production hardware and run some
tests to help you make up your mind about whether
*FIR WLS[MRK SǺ E TVSXSX]TI SJ XLI &GXMZI
(SSPIV JSV 7EWTFIVV] 5M  you’re going to need to cool your Raspberry Pi 5.

66 magpiGG -IEXMRK (SSPMRK 7EWTFIVV] 5M 


5VSGIWWSV
XIQTIVEXYVI MR
s( EKEMRWX XMQI
MRcWIGSRHW &X
XMQIc8"8lj WXVIWW
XIWXMRK [EW WXEVXIH

No cooling
?SPʭ]^__STYR_ZOZT^_ZXPL^`]PbSL_SL[[PY^
when your Raspberry Pi 5 is not cooled. Without

How we measure any cooling in place, Raspberry Pi 5’s CPU idle


temperature is around 65 °C when sitting out in

CPU temperature
The vcgencmd command is an amazingly useful
the open air on the lab bench.
For normal use adding cooling is optional. If
you’re watching a YouTube video, or working on
source of information about the things that are the desktop, you aren’t going to be stressing the
happening on your Raspberry Pi, and the Python CPU like we did in this test. But, unsurprisingly,
bindings (magpi.cc/vcgencmd) surface all of with the heavy sustained load we’re imposing
that and let you programmatically monitor pretty on the CPU with no cooling the maximum
much everything that needs monitoring. Here temperature climbs to and then remains stable
8LI GPSGO WTIIH
we’re going to use the vcgencmd Python bindings just above the 85 °C thermal limit during extended MRXIVQMXXIRXP] XLVSXXPIH
to monitor and log the temperature, along with testing. This leads to sustained thermal throttling SR ER YRGSSPIH
7EWTFIVV] 5M
the current CPU clock speed and throttling state, after the temperature reported by the processor YRHIVKSMRK E WXVIWW
XIWX XS QEMRXEMR E
_ZLʭWP^PPmeasure_temp.py, p69). rises above the throttling limits.
GSRWXERX QE\MQYQ
Once we have the script up and running in a XLIVQEP XIQTIVEXYVI
Terminal window, we can open up another and
VTNVZʬL^_]P^^_P^_ZYLWWQZ`]NZ]P^_ZWZLO
the CPU. To do that, I’m going to use the stress
(magpi.cc/stress) command line tool to impose a
heavy workload on all four of the CPU cores.

$ sudo apt install stress


$ stress --cpu 4

To prevent overheating, all Raspberry Pi


boards begin to throttle the processor when the
temperature reaches 80 °C, and throttle even
further when it reaches the max temp of 85 °C.

-IEXMRK (SSPMRK 7EWTFIVV] 5M  magpiGG 67


7EWTFIVV] 5M  [MXL ER &GXMZI (SSPIV ǻXXIH

Fitting the will be turned on, at 67.5 °C fan speed will be


TYN]PL^POLYOʭYLWWdL_" {._SPQLYbTWWTYN]PL^P

Active Cooler
I then ran the same test with managed active cooling
to full speed. When the temperature drops back
below these limits, the blower’s fan will spin
down automatically.
using the new Active Cooler, and then with the Thanks to the passive heatsink, with the
,N_TaP.ZZWP]^_TWWʭ__POM`_bT_S_SPMWZbP]ɪ^QLY ,N_TaP.ZZWP]ʭ__PObP^PPLX`NSWZbP]TOWP
disconnected. Both these tests were done with the temperature, around 45 °C. During extended
Raspberry Pi sitting in the open air on the lab bench. testing under load, the fan of the Cooler spins up
The Active Cooler is a single-piece anodized at low speed to stabilise the CPU temperature at
aluminium heatsink with an integrated blower. It 60 °C, with a maximum temperatures of 62 to 63 °C
5VSGIWWSV has pre-applied thermal pads for heat transfer, and being seen during the tests.
XIQTIVEXYVI MR
s( EKEMRWX XMQI MR is mounted to the Raspberry Pi 5 board directly using Noise levels of between 35 to 40 dB were
WIGSRHW &X XMQI
8"8lj WXVIWW XIWXMRK
spring-loaded push pins. It is actively managed by measured during the load test while the fan
[EW WXEVXIH =L^[MP]]d;Tɪ^ʭ]XbL]P,_! {._SPMWZbP]ɪ^QLY was in operation – that’s about as much noise
as you’ll make turning the page of a book.
During the extended stress testing the fan never
actually needed to run at full speed to maintain
temperature control of the Raspberry Pi.
Unplugging the fan and relying solely on
the passive cooling provided by the aluminium
heatsink, the idle temperatures were similar,
but under extended load the CPU temperature
eventually reaches the point at around Tҩ + 200
seconds where thermal throttling occurs.
Reattaching the cable causes the fan to spin
up to full speed immediately, and with the
load removed, the CPU is cooled back to an idle
temperature of around 45 °C within a further 300
seconds, with the fan spinning back down to lower
speeds as the temperature falls back to normal.

68 magpiGG -IEXMRK (SSPMRK 7EWTFIVV] 5M 


For normal
usage of your
Raspberry Pi,
adding cooling
is entirely
optional
 8LIVQEP MQEKI SJ ER 7EWTFIVV] 5M  YRHIV PSEH PIJX ERH [MXL &GXMZI (SSPIV VMKLX

But what about


a HAT?
The big question a lot of folks will have at this
point is, what happens when you add a HAT?
Well, you can mount a HAT above the Active
Cooler using a set of 16mm GPIO extenders.
Inevitably there is some disruption to the air
ʮZbbSTNSbTWWNL`^P_SP=L^[MP]]d;T_Z]`Y
hotter, but the Active Cooler is still able to
SLYOWPPc_PYOPO^_]P^^_P^_^bT_SZ`_^TRYTʭNLY_
temperature rises.
Testing was done with a prototype of the new
M.2 HAT, booting Raspberry Pi from the NVMe
drive – both because I happened to have one on
my desk, and also because this is going to be a
pretty common use case for the Raspberry Pi 5
– and just a reminder: the only thing you really
need to remember about the prototype M.2 HAT is
that the production version will almost inevitably
look nothing like the one in this picture!
BT_S_SP83,?ʭ__POLMZaP_SP,N_TaP.ZZWP]
8LI RI[ 7EWTFIVV] 5M  [MXL XLI &GXMZI (SSPIV ERH E TVSXSX]TI SJ XLI YTGSQMRK 2 -&8
the idle temperature of the Raspberry Pi was
slightly higher than without the HAT present, at
around 49 °C.
Under sustained load the CPU temperature
initially rose to the second 67.5 °C trigger point,
spinning the blower’s fan up from low to its
middle speed. However, this quickly dropped
the CPU temperature below the trigger point, 5VSGIWWSV
XIQTIVEXYVI MR
which in turn dropped the fan speed back to s( EKEMRWX XMQI MR
WIGSRHW &X XMQI
its lower setting. The CPU temperature then
8"8lj WXVIWW XIWXMRK
stabilised at around 64 °C for the remainder of [EW WXEVXIH
the sustained testing.

-IEXMRK (SSPMRK 7EWTFIVV] 5M  magpiGG 69


7EWTFIVV] 5M ƶW
GPMTXSKIXLIV
Using
GEWI GSQIW [MXL
E FYMPXMR JER the new case
Next on the test bench was the new fan case.
I removed the Active Cooler from my board,
LYObPY_LSPLOLYOʭ__PO_SP=L^[MP]]d;T 
inside the new case. The new case comes as four
components; the base which the Raspberry Pi clips
TY_Z_SPYLQ]LXPLYOQLYL^^PXMWdLYOʭYLWWdL
lid that clips on top.
Like the Active Cooler, the fan assembly is
LN_TaPWdXLYLRPOMd=L^[MP]]d;Tɪ^ʭ]XbL]P%L_
60 °C the blower’s fan will be turned on, at 67.5 °C
QLY^[PPObTWWMPTYN]PL^POLYOʭYLWWdL_" {._SP
fan increases to full speed. When the temperature
drops back below these limits the fan will spin
down automatically.
Testing was carried out in the same fashion
L^MPQZ]Pʭ]^_bT_S_SPQLYL^^PXMWdTY[WLNP
but with the lid removed. Then again with both

Like the active


cooler, the fan is
actively managed
by raspberry pi’s
firmware

fan assembly in place, and this time with the lid


clipped on top.
Using the fan case we see idle temperatures
a couple of degrees hotter than with the Active
Cooler on its own, at around 48 °C. With the
lid removed we see maximum temperature of
approximately 72 °C under sustained load, and
with the lid in place we see a marginally higher
maximum of around 74 °C under load.
We can see that while temperature under load is
higher than with the Active Cooler, the maximum
temperature under load is still well below the 80
and 85 °C throttling temperatures.

5VSGIWWSV XIQTIVEXYVI MR s( EKEMRWX XMQI MR WIGSRHW


&X XMQI 8"8lj WXVIWW XIWXMRK [EW WXEVXIH

70 magpiGG -IEXMRK (SSPMRK 7EWTFIVV] 5M 


Conclusions
For normal use adding cooling is optional,
although performance may be improved with
the addition of active cooling. However a heavy
continuous load, such as rebuilding the Linux
kernel, will force the new Raspberry Pi 5 into
thermal throttling. For heavy loads thermal
throttling can extend processing times, and
[L^^TaPNZZWTYRT^[]ZMLMWdRZTYR_ZMPTY^`ʯNTPY_
thermal management for heavy loads that extend
beyond 200 or 300 seconds of duration, with active
cooling necessary to prevent thermal throttling
from occurring. 5VSGIWWSV
XIQTIVEXYVI MR
When deciding on a cooling solution you should Cooling of any type isn’t mandatory, s( EKEMRWX XMQI MR
consider what sort of use you’re going to put your no harm will come to your Raspberry Pi WIGSRHW &X XMQI
8"8lj WXVIWW XIWXMRK
Raspberry Pi 5 to, and make a decision on cooling if it’s left uncooled — and even while [EW WXEVXIH
based on that, rather than just arbitrarily adding throttling under heavy load, a Raspberry
cooling. Because for a lot of day-to-day use cases, Pi 5 is still faster than an unthrottled
it’s not going to be needed. Raspberry Pi 4.

measure_temp.py DOWNLOAD
THE FULL CODE:
> Language: Python magpi.cc/github

001. import sys


002. import os
003. import time
004.
005. from vcgencmd import Vcgencmd 8LI &GXMZI (SSPIV
QEOIW WYVI
006. 7EWTFIVV] 5M  VYRW
007. def main(): WQSSXLP] [LMPI
[SVOMRK MXW LEVHIWX
008. start_time = time.time()
009. fb = open(“/home/pi/readings.txt”,”a+”)
010. fb.write(“Elapsed Time (s),Temperature (°C),Clock Speed (MHz),Throttled\n”)
011. vcgm = Vcgencmd()
012. while True:
013. temp = vcgm.measure_temp()
014. clock = int(vcgm.measure_clock(‘arm’)/1000000)
015. throttled = vcgm.get_throttled()[‘breakdown’][‘2’]
016.
017. string = ‘%.0f,%s,%s,%s\n’ % ((time.time() - start_time),temp,clock,throttled)
018. print(string, end=’’)
019. fb.write(string)
020. time.sleep(1)
021.
022. if __name__ == ‘__main__’:
023. main()

-IEXMRK (SSPMRK 7EWTFIVV] 5M  magpiGG 71


Raspberry Pi 5 benchmarks reveal
a significant performance boost.

By Alasdair
Allan

T
here is nothing so important to an engineer
who gets their hands on a new bit of
SL]ObL]PL^_ZTXXPOTL_PWd_]dLYOʭR`]P
Z`_SZbQL^_T_NLYRZ On the other hand, there
is nothing more hotly debated between engineers
as to how to measure how fast things go. But like
many things, what you should measure really
depends on how and why you will be using the
SL]ObL]PTY_SPʭ]^_[WLNP
,^Z`],XP]TNLYQ]TPYO^XTRS_^LddZ`]
mileage may vary (XLR[TNNdXXa).

72 magpi.cc Benchmarking Raspberry Pi 5


Benchmarking with Geekbench
There are many benchmarking frameworks, but If you’re running the 64-bit distribution of
Geekbench is mine (RPPVMPYNSNZX), and why Raspberry Pi OS, it ships with 16KB page size
it’s mine comes back to the question of how and enabled, which gives slightly improved performance
why. Instead of just straight-up crunching some at the expense of compatibility with older ARMv7
pointless numbers, Geekbench takes a stab at 32-bit binaries.
]`YYTYR_P^_^_SL_L__PX[__Z]PʮPN_SZb[PZ[WP So we’ve also gone ahead and tested a Raspberry
normally use their computers: loading a website, Pi 5 computer using both 16KB and 4KB page
]PYOP]TYRL;/1LYOLOOTYRʭW_P]^_ZLYTXLRP size. To do that we’ve used an internal build of
Like a lot of other benchmarks, Geekbench Geekbench 6.2 which is patched to support 16KB
headline scores are split into single-core and [LRP^TeP^_SPZʬ_SP]LNV]PWPL^PbZYɪ_bZ]V
multi-core scores. However, just due to the nature with 16KB page size, and needs you to reboot and
of the benchmark, Geekbench scores can vary a lot use a 4KB page size).
from run to run. Setting force_turbo=1 in NZYʭR For Geekbench benchmarks, bigger numbers
txt and avoiding things like software updates are better!
somewhat reduces the noise between runs, but the
best strategy is to average multiple runs. Which is
what we’ve done.
Multi core
Multi-core scores attempt to measure the more

Single core
Single-core scores measure the processing
realistic case where jobs are being distributed
across all the cores of the board’s CPU. These
sorts of scores are more relevant for heavily
power of one CPU core and are more relevant threaded applications such as web browsers,
for applications that are lightly threaded, bSTNSRPYP]LWWd_]d_ZZʰZLOTYOTaTO`LW_LM^
meaning they rely mostly on a single core to into separate process threads.
process instructions. Over one hundred runs of Geekbench 6 we
Over one hundred runs of Geekbench 6 saw saw an average score of 1,604±22 for Raspberry
an average score of 764±6 for Raspberry Pi 5 Pi 5 using a 4KB page size, and 1588±63 using a
using a 4KB page size, and 774±6 using a 16KB 16KB page size. That’s a ×2.2 speed increase over
page size. That’s a ×2.4 speed increase over Raspberry Pi 4.
Raspberry Pi 4.

MULTI CORE SCORE


SINGLE CORE SCORE Raspberry Pi 5
1588
(16KB page size)
Raspberry Pi 5
774
(16KB page size)
Raspberry Pi 5
1604
(4KB page size)
Raspberry Pi 5
764
(4KB page size)
Raspberry Pi 4 723

Raspberry Pi 4 340

Benchmarking Raspberry Pi 5 magpi.cc 73


Overclocking to 3.0GHz
Overclocking Raspberry Pi 5 is something you do at and the GPU from 800MHz to 1GHz, we see a
your own risk, and Raspberry Pi doesn’t necessarily corresponding increase in performance with a
recommend it. But, that said, we have a tutorial on ×1.2 increase in score on the single-core tests.
Overclocking this issue for folks that want to live Interestingly, we don’t see a similar increase
dangerously (see page 40). in performance in the multi-core tests. This
So if you want to take Rasbperry Pi 5 up in speed, discrepancy is probably down to constraints on
here is what kind of performance increase you can memory bandwidth, but it’s hard to tell for sure.
look forward to.
Overclocking the CPU from 2.4GHz to 3.0GHz,

2.4GHZ 3.0GHZ

Single-core score 774 906

Multi-core score 1604 1634

Other people, other benchmarks


While that was my benchmark, you shouldn’t just numbers (XLR[TNNUPʬ MPYNSXL]V^ for
_LVPXdbZ]OQZ]T_DZ`^SZ`WOOPʭYT_PWdRZWZZVL_ everything from Ethernet and wireless throughput,
what other people have done around benchmarking to memory throughput, to cryptographic
and performance testing on our new hardware. performance – where Raspberry Pi 5 is 45 times
Because, as you’d expect, after perhaps looking faster than Raspberry Pi 4 thanks to the BCM2712
L__SP]XLW^^PP[LRP_SPʭ]^__STYRXZ^_ processor bringing Arm’s Cryptographic Extension
people did when they got their hands on a preview to Raspberry Pi (XLR[TNNL"!N]d[_ZR]L[STN).
Raspberry Pi 5 was to run some benchmarks, which The benchmarks I found the most interesting
gives us lots of numbers and graphs. are the ones are from Seeed Studio, who have gone
,^LWbLd^5Pʬ2PP]WTYRSL^[P]QZ]XLYNP out and benchmarked Raspberry Pi 5 (XLR[TNN

Cryptographic
benchmarks for
Raspberry Pi 4 and
cF]/IǺ,IIVPMRK

74 magpi.cc Benchmarking Raspberry Pi 5


^PPPO MPYNSXL]V^) using the ncnn framework
(XLR[TNNYNYY).
The ncnn benchmark (XLR[TNN
YNYYQ]LXPbZ]V) is a deep-learning inference
framework that supports various neural network
models – such as PyTorch and TensorFlow –
and a range of hardware. Designed with mobile
OP[WZdXPY_TYXTYOT_ZʬP]^2;@LNNPWP]L_TZYaTL
the Vulkan API, and it’s been really interesting to
see the sort of performance increases we’re seeing
between Raspberry Pi 4 and 5.
Remember though, unlike my own Geekbench
benchmarks, here smaller numbers are better, and
they were getting some really nice numbers from
Raspberry Pi 5. Testing the YOLOv8n (dZWZa#NZX)
model on Raspberry Pi 5 with a 640×640 pixel video
stream, gave an inference rate of around 12fps.

We’re pretty proud of the


Wrapping up performance improvements
When we launched Raspberry Pi 4 back in 2019,
with its quad-core Arm Cortex-A72 processor
we’ve been able to make
clocked at 1.5GHz, it was around 40 times faster
than the original Raspberry Pi model from 2012.
But Raspberry Pi 5, with its quad-core Arm
'IRGLQEVOWVIWYPXW
Cortex-A76 processor clocked at 2.4GHz, means showing the
we now have between two and three times We’re pretty proud of the performance performance
improvements from
the CPU and GPU performance again; roughly improvements we’ve been able to make. But (SVI*PIGXVSRMGW
(magpi.cc/
twice the memory and I/O bandwidth; and for best of all, is seeing folks out in the wild core5benchmarks)
_SPʭ]^__TXPbPSLaP=L^[MP]]d;T^TWTNZYZYL ʭYOTYR Z`_PcLN_WdSZbQL]bPɪaPNZXPTY_SP
ʮLR^ST[=L^[MP]]d;TOPaTNP last few years.

Some ncnn
framework
benchmarks from
Seeed Studio

Benchmarking Raspberry Pi 5 magpi.cc 75


REVIEW

PicoVision
(Pico W Aboard)
Pimoroni magpi.cc/picovision £35 / $37

SPECS This pocket-sized digital video stick brings Pico


games and more to the big screen. By Phil King
FEATURES:
Pico W, separate

A
RP2040 (GPU),
imed mainly at fans of retro gaming and for programming in MicroPython or C/C++, or
2 × 8MB PSRAM,
PCM5100A DAC old-school programming, PicoVision is ʮL^STYR;TNZBbT_SYPbʭ]XbL]P
for audio, 3 × user a surprisingly capable digital video stick Alternatively, PicoVision can be powered via two
buttons, status with a pre-soldered Raspberry Pi Pico W on board. unpopulated pins. There’s also a breakout header
LED, reset button, Using Pico W’s RP2040 microcontroller chip as for CPU and GPU debugging, plus a few other GPIO
microSD card slot
the CPU, it adds a second RP2040 to act as a GPU to pins. A single Qwiic/STEMMA QT port can be used
CONNECTIONS: help handle the big-screen visuals. Two extra 8MB to connect I2C breakouts or sensors.
HDMI video out, =,8NST[^L]P`^PO_Z^bL[Q]LXPM`ʬP]^MP_bPPY On the front of the board are three user buttons,
3.5mm audio line the two RP2040s, enabling PicoVision to output an activity LED, and a handy reset button. At the
out, breakout
reasonably high-res graphics (for a microcontroller) rear is the bonus of a microSD card slot to provide
header, Qw/ST
port, micro USB to a monitor via a standard HDMI output. extra storage for assets such as graphics.
(on Pico W) The only slight drawback is that it’s not able to

DIMENSIONS:
output audio via HDMI. For this, there’s a 3.5mm Instant menu
87 × 38 × 9mm stereo line out jack to connect a pair of PC speakers Getting started is as easy as connecting PicoVision
or headphones. to an HDMI monitor or TV and powering it up. It
Power is connected using Pico W’s micro USB NZXP^[]PʮL^SPObT_S8TN]Z;d_SZYʭ]XbL]P
port – as usual, you can hook this up to a computer that auto-runs a menu of example programs. The

The front of the


PicoVision board
features a pre-
soldered Pico W
and user buttons.
The holes are
an unpopulated
breakout header

76 magpi.cc PicoVision (Pico W Aboard)


REVIEW

On the rear are a


microSD card slot,
Qw/ST connector,
audio line out and
HDMI, plus the extra
RP2040 ‘GPU’ chip

A and X user buttons are used to move up and aP]^TZYZQ_SPʭ]XbL]PbT_S`[_Z_PY[P]LYd


down through the menu options; and a press of single scanline.
the Y button will select one.
Among the example programs are a fun Start coding
Flappy Bird-style game, magic mirror dashboard, When it comes to programming PicoVision
and Teletext-style headlines – the last two yourself, a comprehensive GitHub repo (magpi.cc/
require connection to a Wi-Fi network. picovisiongh) provides lots of useful info, along
with MicroPython and C/C++ libraries and code
Verdict
Among the example examples from which to learn. The most basic are
Hello World programs to print text to the screen.
With a second
RP2040 and extra

programs are a fun Flappy Graphics are handled using Pimoroni’s standard
PicoGraphics module, while a PicoSynth sound
RAM to boost Pico
W’s capabilities,

Bird-style game, magic module is used to play simple tunes and noises
PicoVision
ŅýåųŸŞĬåĹƋƼŅü
using I2S audio from the board’s DAC chip. ŞŅŸŸĜÆĜĬĜƋĜåŸüŅų
mirror dashboard, and You’ll also want to try playing classic Doom on retro gaming and
;TNZAT^TZYɧbSTNSbZ]V^]PLWWdbPWW5`^_ʮL^S coding projects.
Teletext-style headlines

9
the Doomʭ]XbL]P@1_Z;TNZAT^TZYLYOLOO_SP
RLXPɪ^B3CʭWP_ZLXTN]Z>/NL]O1Z]NZY_]ZW

/10
Several graphical demos showcase PicoVision’s you’ll need to connect a USB keyboard via a splitter
NL[LMTWT_TP^ ?SP^PTYNW`OPLNWL^^TN/^_L]ʭPWO cable (as supplied in the optional accessory kit).
PʬPN_]PXPXMP] BTYOZb^ɪ^^N]PPY^LaP]*L
screen modes menu with numerous resolutions
(some require GPU overclocking), and a parallax
scrolling animation that makes use of PicoVision’s
scroll modes – up to seven groups of scanlines can
be scrolled separately.
Up to 80 sprites can be shown on screen
simultaneously (or 32 with the special widescreen

A scroll groups code example demonstrates the ability


to scroll several areas of the screen independently Yes, you can play Doom on PicoVision! Use a splitter cable to plug a USB keyboard into Pico W

PicoVision (Pico W Aboard) magpi.cc 77


Electronics housings…
as a complete kit.
Available exclusively from our global distribution
and wholesale partners you will find the right
housing for every application.

With wall, desk & DIN rail mounting options our


kits make it easier for you to select the next housing
solution for your electronics design.

For additional information call 01952 681700 or visit


https://phoe.co/housings-kits-uk
RESOURCES

10 Amazing:
3D prints simplyRetro Z5
Comfy and large
Print your own custom project
Some 3D printed handheld consoles are very small and portable, but
pieces for Raspberry Pi ŸŅĵåƋĜĵ埱ÆĜččåųŸÏųååĹĜŸĵŅųåÏŅĵüƼţ‰Ęå¬ĂŅýåųŸƋĘĜŸţ

magpi.cc/retroz5

3
D printing and making go hand-in-hand, and these amazing
prints and projects involving Raspberry Pi are fantastic
ways to upgrade, or even realise your dream project. After
many years, there’s a huge range to choose from – here’s just ten Rapiro
we like.
Bipedal robot friend
Rapiro was a very cool kit
from several years ago
which always had open
ŸŅƚųÏ儉XĀĬ域ŅƼŅƚ
could print your own.

magpi.cc/rapirostl

RaspBMO ZeroBot
Friendly console Practical and small
While this BMO will be able to emulate games, it’s also just a nice This cool looking robot for Raspberry Pi Zero is great for remote
thing to have sitting on your desk. controlling and looking where you’re going with computer vision.

magpi.cc/raspbmo magpi.cc/zerobot

3D prints magpi.cc 79
RESOURCES

Pipboy 3000 MKIV


NinTastic
Perfect cosplay prop
We’ve seen many iterations of a Fallout-inspired Raspberry Pi-powered Retro gaming case
Pipboy over the years, and this is one of the best. If you want to give your retro gaming Raspberry Pi a more suitable
home, check out this great case.
magpi.cc/piboy3000
magpi.cc/nintastic

Gameboy
NANO
Small and portable
This very tiny handheld console
ĀƋŸ±ŸŞÆåųųƼ{Ĝ¬åųŅôƚŞčų±Úå
ƋŅ¬åųŅƖ±ĹÚƵ±ƋÏĘĜƋųå±ĬĬƼāƼţ

magpi.cc/gameboynano

Case with
Tank Bot camera mount
Treads for grip Goose neck mount
There are many robots on Thingiverse – we quite like this one as it can be
Watching your 3D printer with a
used for rough terrain better than normal wheels
3D-printed Raspberry Pi stand may be
a little meta, but it’s fun and useful.
magpi.cc/tankbot
magpi.cc/casewithcam

Retro
desktop tower
FreeCAD for Makers
Nostalgic protection
Fancy making your own 3D
More powerful than a ’90s PC, and a prints? Our colleagues at
neat way to present Raspberry Pi. HackSpace magazine put
together a great resource for
magpi.cc/retrotower designing 3D models in FreeCAD

80 magpi.cc 3D prints
Your FREE guide to
making a smart TV

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

FROM THE MAKERS OF THE OFFICIAL RASPBERRY PI MAGAZINE

magpi.cc/mediaplayer
RESOURCES

Learn Scratch
with Raspberry Pi
Resources to help you start coding with
the block-based language. By Phil King

Code Club Scratch Modules


Raspberry Pi Part of the Raspberry Pi categories) and stack them
AUTHOR

Foundation Foundation, Code Club is all together to build programs


about getting young people to to control interactive sprites
Price: learn to program, whether by on a ‘stage’. So it’s ideal for
Free
taking part in free coding clubs complete beginners to learn
magpi.cc/ around the globe or from home the key concepts of coding.
codeclubscratch
using a host of online resources Code Club’s three
– including a set of modules Scratch modules progress
based on Scratch. TYOTʯN`W_dLYO_LVPdZ`
Created by the MIT Media Lab, through aspects such into sections: Explore (get new
this block-based programming as sprites, loops, variables, skills), Design (make design
language enables users to conditionals, and Boolean decisions), and Invent (create
drag and drop various blocks logic. Each module comprises a new solution). It’s a fun and
(arranged into colour-coded six projects to create, arranged PʬPN_TaPbLd_ZWPL]Y

Reading material
Books to help CODING WITH SCRATCH sturdy cards covering various projects
Part of the QuestKids series aimed at – such as Pong Game and Virtual Pet
you learn youngsters, this colourful 80-page – with instructions to make them.
Scratch coding guidebook sees the cartoon gang nostarch.com/scratchcards3
show you how to create platform
games. There’s also a second Scratch CODING FOR BEGINNERS
book that covers driving games. USING SCRATCH
magpi.cc/qkscratch This appealing spiral-bound Usborne
book helps you to get started with
OFFICIAL SCRATCH Scratch and create a range of projects
CODING CARDS including animations and simple
8LMWWIXSJǼEWLGEVHWFVIEOW games. There are also handy tips and
simple projects down into easy-to- links to working projects.
follow steps. There are ten sets of magpi.cc/usbornescratch

82 magpi.cc Learn circuits with Raspberry Pi


RESOURCES

Scratch Ideas
MIT Media Lab ,[Z[`WL]^PN_TZYZQ_SPZʯNTLW with an educator guide if you’re
Online
AUTHOR

Scratch site, Scratch Ideas helping someone to learn. Upon


Price:
Free
T^bSP]PdZ`ɪWWʭYOLM`YNS
of helpful activity guides,
clicking ‘Try the tutorial’, you’re
presented with the usual online
courses
scratch.mit.edu/ideas including a Getting Started >N]L_NSTY_P]QLNPbT_SLʮZL_TYR
one for newbies. window. The latter plays a Free Scratch
0LNSR`TOPZʬP]^L^P_ZQ short introductory video before courses to join
coding cards to download, along proceeding to a multi-step guide
that shows you everything you
need to complete the project.
4_ɪ^LYPʬPN_TaPbLd_ZWPL]Y
how to use the numerous blocks
and features in Scratch.
There’s also a set of starter
[]ZUPN_^_Z]PXTcTYʭaP
categories – animation, games, EDX CS50 SCRATCH
interactive art, music and dance, Created by Harvard, this self-
stories – that showcase the paced three-week introduction
versatility of Scratch. to Scratch forms part of the
university’s renowned CS50
computer science course.
Concepts covered include
functions, events, conditions

Scratch Team
loops, and variables.
magpi.cc/cs50scratch

YouTube Channel TOWER DEFENCE GAME


Aimed at beginners and
Scratch Team If you like to learn by watching There are also guides to making intermediate coders, this
AUTHOR

aTOPZ^_SPZʯNTLW>N]L_NS?PLX OTʬP]PY__d[P^ZQ[]ZUPN_^ video series shows how to


Price: channel on YouTube is an ideal including a Pong game and set up a basic tower defence
Free
destination. Tutorials include virtual town. game, add game logic and
youtube.com/
how to remix the built-in The Tips & Tricks selection rules, design UI elements,
@ScratchTeam
Scratch sprites, create new ones, covers useful pointers in two incorporate sound and music,
import your own drawings, categories. ‘Unlock the Block’ then test and debug it.
plus add and record sounds. videos help you to ‘unlock magpi.cc/scratchtdgame
the magic’ behind some of
the key Scratch blocks, while
‘Scratching the Surface’ is a 5 PROJECTS IN 5 DAYS
series of one-minute videos Subtitled ‘Scratch Game
that explain intermediate-level Programming for Kids’, this
coding concepts. beginner-level course by the
DZ`ɪWWLW^ZʭYO^ZXP.]PL_P Little Apple Academy shows
Along videos of livestreams in LS[XSGVIEXIǻZIWMQTPI
which the Scratch Team create interactive animations and
a project in an hour, along with games. Video-based, it’s fun
Scratcher Stories and video to follow.
updates from the team. magpi.cc/5projects

Learn circuits with Raspberry Pi magpi.cc 83


INTERVIEW

Jorvon
Moss
A maker and roboticist known commonly as
Odd Jayy, Jorvon creates cool stuff for Digi-Key

> Name Jorvon Moss > Occupation Technical Content Creator


> Community role Maker > URL magpi.cc/oddjay

I
f you’ve been to major
Maker Faires in the US
recently you’ve likely see
Jorvon, aka Odd Jayy, and his
amazing steampunk creations.
Sometimes robots, sometimes
wearables, and always very
cool. He describes himself as
an oddity, hence the name
Odd Jayy.
“I have an art background,
BFA in Illustration, and self-

He describes himself
as an oddity, hence
the name Odd Jayy
taught electronics. but mainly
focus on character based
robotics,” Jorvon tells us. “I
just decided to start [making]
one day in college as a hobby
but then realized it was a
passion of mine. I started
learning back in 2014, but it has
only been my full time job for
the last two years.”

When did you learn about


Raspberry Pi?
I learned about Raspberry Pi
back in 2014, and to be honest Binary 2.0 is a cute robot that Jorvon hopes to bring to events

84 magpi.cc Jorvon Moss


INTERVIEW

Meet M3RVN, the


AI-powered, shoulder-
perched robot

Jorvon is always
working on
RI[cVSFSXW

4M]ZVPXdʭ]^_=L^[MP]]d;T What’s your favourite


by trying to solder directly onto creation you’ve made with
the board, but I have learned Raspberry Pi?
since then and Raspberry Pi My favourite thing made with
is now one of my personal Raspberry Pi so far has been
favourite boards. my AI robot M3RVN and my
bubble-blowing robot Binary.
How do you like to
`^P=L^[MP]]d;T^_`ʬ What inspires your creations?
(including Pico)? >NTʭTY^[T]P^XdbZ]VXZaTP^
I like to use Raspberry and books. I love making fun
Pi in a lot of my projects robotic designs and imagining a
and I love Pico. I use Pico world they live in.
a lot now, being a very
strong and easily accessible BSP]PNLYbP^PPdZ`]^_`ʬ*
microcontroller. But when DZ`NLYʭYOXZ^_TQYZ_LWWXd
I want a robot with a lot of work on instagram.com/odd_
computing power I grab a Jayy and my documentation on
Raspberry Pi 4 and now 5. magpi.cc/oddjay Jorvon loves to use Pico in his builds

Jorvon Moss magpi.cc 85


THIS MONTH IN RASPBERRY PI

MagPi
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 01
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 like a nice custom home sensor suite


02. 3D printing cases is a great way to keep
your Raspberry Pi safe
03. A nice live light is useful whether you’re
working from home or streaming on Twitch
04. This is cool and we love how low-tech and
cheap this solution is
05. The Digital Maker badge is something we
wish we had when we were kids
06. Wonder what the scale of this is compared
to the original
07. This is a cool little project – check out
HackSpace 55 and Andy’s Hackaday
JSVcQSVIMRJS 02
08. Kev’s robots invaded Italy recently, with
some Raspberry Pi 5 power ups
09. Sound catcher or sound shooter? Do
]SYcRIIHEWMKLXJSVWSYRHW$;ILEZI
many questions…

86 magpi.cc MagPi Monday


THIS MONTH IN RASPBERRY PI

03

04

05

06

07

08

09

MagPi Monday magpi.cc 87


THIS MONTH IN RASPBERRY PI

Events in pictures:
Raspberry Pi 5 launch
at the Raspberry Pi Store
Raspberry Pi 5 is here! We caught up
with folks buying their boards on day one

I
n the Grand Arcade at Cambridge, the
01
Raspberry Pi Store usually opens at
a reasonable 10am but on Monday 23
October we were there at a pre-dawn 7:30
am to witness the release of Raspberry Pi 5
at 8am. While there weren’t the huge lines
you’d see at a pop up, a handful of die-hard
Raspberry Pi fans were ready to get their new
everything computer.

01. People were able to reserve their


Raspberry Pi before hand or just buy
SRIcMJXLI]JERGMIHSRXLIHE]
02. Boards, PSUs, cases, and coolers
[IVIcEZEMPEFPIXSKVEF
03. Experience Raspberry Pi 5 at the
WXSVIcFIJSVIFY]MRKSRI
04. The calm before the storm with
+IEXYVIWc*HMXSV7SF
03
02
04
THIS MONTH IN RASPBERRY PI

Crowdfund this!
Crowdfunding projects for Raspberry Pi accessories

MULTI-IO HAT CrowVision


“The MULTI-IO HAT combines two of each of the most We reviewed CrowVision a few issues ago and thought it was
needed interfaces used in industrial automation: digital a great display for many kinds of Raspberry Pi projects. It’s now
and analogue inputs up for crowdfunding and already passed its goal. The Crow line
and outputs, RTD has always been good, so we’re looking forward to seeing more
measurement and displays in this vein too.
relays. Expandable
to eight layers, it
can perform from
the simplest to
the most complex
industrial and home
automation tasks.”

kck.st/3QcioER magpi.cc/crowfund
YOUR LETTERS

Your
Letters
Priority boarding period
I have been on holiday and found out about the priority
boarding codes long after the magazine came out – is
it too late for me to get one of these codes?

Susan via email

Priority Boarding is something we’ll be honouring for


new print subscribers for the near future – go and check
magpi.cc/priorityboarding for info on this. Codes can
take up to two working days to be sent out.
If you’re an existing subscriber and still don’t
have your code, please make sure to email us at
magpi@raspberrypi.com and we can get it to you.
Head to Victoria Gate in Leeds to see
the Raspberry Pi seasonal pop-up

Leeds pop-up store


I was surprised to see that there was a Raspberry Pi Pi pop-
up store in Leeds the other day – I don’t remember this being
announced? Did I miss a blog or email about it?
We’ve reserved Raspberry Pi 5 boards
for The MagPi subscribers Harry via email

The Leeds Raspberry Pi Store was supposed to be a big surprise and


it’s not a weekend pop-up like the rest of the pop-up shops this
year – this one will be open until the end of December. It’s a nice
magpi.cc/priorityboarding big store as well, with many of the features of the one in Cambridge!
Check out raspberrypi.com for more info on the shop, and make
sure to drop by and buy several copies of The MagPi and our books
You still have a while yet to get your own Priority
Boarding code to obtain Raspberry Pi 5 faster while you’re there.

90 magpi.cc Your Letters


USA SPECIAL!
6 ISSUES
Back issues
Do you have any copies of issue 123 that I can
order, or are you planning to print any more?
I regrettably missed it and am now looking to
FOR $43
complete my collection.

Az via Facebook

Unfortunately we don’t reprint magazine issues so


when they’re gone, they’re gone. However, after
three weeks each issue becomes freely available as
a PDF on our website (magpi.cc/issues) and you’re
welcome to print it for yourself if the PDF is not
enough for you.

FREE
RASPBERRY PI
PICO W
All our issues are available as PDFs from magpi.cc/issues

Contact us!
> Mastodon magpi.cc/mastodon
> Threads @themagpimag
> Facebook magpi.cc/facebook
> Email magpi@raspberrypi.com
> Online forums.raspberrypi.com

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

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

01. Melbourne Raspberry Pi Meetup 03. Cornwall Tech Jam


Sunday 3 December Saturday 9 December
Docklands Makerspace and Library, Fraddon Village Hall, Saint Columb, UK
Melbourne, Australia magpi.cc/ctj136
magpi.cc/mrpm136 Cornwall Tech Jams are run by volunteers working in IT
This meet-up is open to everyone with an interest in and education throughout Cornwall. They are supported
electronics, robotics, home automation, 3D printing, laser by Software Cornwall, its members and other local
cutting, amateur radio, high-altitude balloons, space tech, businesses. Our volunteers give their own time and
etc. Makers are invited to bring along their projects and expertise to plan each Cornwall Tech Jam and to the
project ideas, and come connect with other makers. Get regular maintenance of all our equipment.
]SYVUYIWXMSRWERW[IVIHWLS[SǺXLI[SVO]SYEVIHSMRK
and get support to resolve nagging issues. 04. Mombasa Raspberry Pi Jam Experience
Raspberry Pi 5!
Monday 11 December FULL CALENDAR
Tech Kidz Africa, Mombasa, Kenya Get a full list of upcoming
magpi.cc/rpjm136 ÏŅĵĵƚĹĜƋƼåƴåĹƋŸƤĘåųå×

Raspberry Pi Jam Mombasa is a one-day event for magpi.cc/events


students, teachers, and enthusiasts of robotics and AI.
8LIc/EQ[MPPJIEXYVI[SVOWLSTWHIQSRWXVEXMSRWERH
hands-on activities.
02. Coventry Raspberry Jam: Show and tell
Thursday 7 December
Blue Coat C of E School, Coventry, UK
magpi.cc/crj136
Blue Coat C of E School is hosting a Raspberry Jam
show-and-tell event in the school theatre. The aim for
this event is for people to bring along the Raspberry Pi-
based projects that they have created and share them
with others. There is plenty of seating available, and also
EcTVSNIGXSVGSRRIGXIHXSEHIWOXSTGSQTYXIV

92 magpi.cc Community Events Calendar


EVENTS

04

RASPBERRY PI 01
STORE POP-UP

Raspberry Pi pop-up
Leeds – Experience
Raspberry Pi 5
> Where Victoria Gate, Leeds, UK
> When Saturday 4 November to Saturday 30 December

G
et hands-on with the all-new
Raspberry Pi 5 in our holiday pop-up
02 ^_Z]PZY_SPR]Z`YOʮZZ]ZQATN_Z]TL
Gate in Leeds, England. Experience Raspberry
Pi 5’s blazing performance and check out the
newest accessories. The store will have the full
line of Raspberry Pi products for purchase.
03
XLR[TNN[Z[`[WPPO^

Community Events Calendar magpi.cc 93


Learn coding
Discover how computers work
Build amazing things!

magpi.cc/beginnersguide
COMPETITION

WIN ONE OF TEN


RASPBERRY PI 5
ACCESSORY PACKS!
Enjoying your new Raspberry Pi
5? Make it even better with this
accessory pack, including the
RI[c;9'(59EHMWTPE]
and camera module adapter cable,
ERHER&GXMZI(SSPIVEW[IPP;I
have ten packs to give away.

Head here to enter: magpi.cc/win Learn more: raspberrypi.com/products

Terms & Conditions


Competition opens on 22 November 2023 and closes on 14 December 20235VM^IMWSǺIVIHXSTEVXMGMTERXW[SVPH[MHIEKIHSVSZIVI\GITXIQTPS]IIWSJ7EWTFIVV]5M1XHXLI
TVM^IWYTTPMIVXLIMVJEQMPMIWSVJVMIRHW;MRRIVW[MPPFIRSXMǻIHF]IQEMPRSQSVIXLERHE]WEJXIVXLIGSQTIXMXMSRGPSWIW']IRXIVMRKXLIGSQTIXMXMSRXLI[MRRIVGSRWIRXWXSER]
TYFPMGMX]KIRIVEXIHJVSQXLIGSQTIXMXMSRMRTVMRXERHSRPMRI5EVXMGMTERXWEKVIIXSVIGIMZISGGEWMSREPRI[WPIXXIVWJVSQ8LI2EK5MQEKE^MRI;IHSRƶXPMOIWTEQTEVXMGMTERXWƶHIXEMPW
[MPPVIQEMRWXVMGXP]GSRǻHIRXMEPERH[SRƶXFIWLEVIH[MXLXLMVHTEVXMIW5VM^IWEVIRSRRIKSXMEFPIERHRSGEWLEPXIVREXMZI[MPPFISǺIVIH;MRRIVW[MPPFIGSRXEGXIHF]IQEMPXSEVVERKI
HIPMZIV]&R][MRRIVW[LSLEZIRSXVIWTSRHIHHE]WEJXIVXLIMRMXMEPIQEMPMWWIRX[MPPLEZIXLIMVTVM^IVIZSOIH8LMWTVSQSXMSRMWMRRS[E]WTSRWSVIHIRHSVWIHSVEHQMRMWXIVIHF]
SVEWWSGMEXIH[MXL.RWXEKVEQ+EGIFSSO8[MXXIVSVER]SXLIVGSQTERMIWYWIHXSTVSQSXIXLIWIVZMGI

Competition magpi.cc 95
SUBSCRIBE AND

SAVE UP
TO

35% on the cover price

ISSUE #73

hsmag.cc
NEXT MONTH

Start your Raspberry Pi


EDITORIAL
Editor
Lucy Hattersley
lucy@raspberrypi.com
Features Editor
Rob Zwetsloot
rob@raspberrypi.com
Sub Editor
Ian Evenden

ADVERTISING
Charlotte Milligan
A beginner’s guide charlotte.milligan@raspberrypi.com
+44 (0)7725 368887
to mastering
single-board computing DESIGN
criticalmedia.co.uk

Head of Design
Lee Allen
Designer
Sam Ribbits
Illustrator
Sam Alder

CONTRIBUTORS
Alasdair Allan, David Crookes, Pj
Evans, Rosie Hattersley, Phil King,
Stewart Watkiss, Ashley Whittaker

PUBLISHING
Publishing Director
Brian Jepson
brian.jepson@raspberrypi.com
Director of Communications
Liz Upton
CEO
Eben Upton

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

SUBSCRIPTIONS
Unit 6 The Enterprise Centre
Kelvin Lane, Manor Royal,
#137 Crawley, West Sussex, RH10 9PE
+44 (0)1293 312193
14 DECEMBER magpi.cc/subscribe
magpi@subscriptionhelpline.co.uk

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


from sustainable forests and the printer
operates an environmental management

Build a Beepy MASTODON magpi.cc/mastodon


system which has been assessed as
conforming to ISO 14001.

handheld PC The MagPi magazine is published by


Raspberry Pi Ltd, Maurice Wilkes Building,
THREADS @themagpimag
MyCobot 280
St. John’s Innovation Park, Cowley Road,
Cambridge, CB4 0DS. The publisher,

professional
editor, and contributors accept no
responsibility in respect of any omissions
FACEBOOK magpi.cc/facebook
robotic arm
or errors relating to goods, products, or
services referred to or advertised in the
magazine. Except where otherwise noted,

Recreate the EMAIL magpi@raspberrypi.com content in this magazine is licensed under


a Creative Commons Attribution-

Amiga with
NonCommercial-ShareAlike
3.0 Unported
ONLINE forums.raspberrypi.com
ƔQRR[FTKXG
(CC BY-NC-SA 3.0).
ISSN: 2051-9982.
THE FINAL WORD

Christmas with
Raspberry Pi 5
Writing about Christmas in early
November is weird, even for Rob Zwetsloot

T
hese Final Word columns tend about turkey dinners and stockings had trouble balancing it on my fake
to be one of the last things on a rainy October evening. tree. I should also get them all
we write for the magazine, automated with voice commands.
meaning that even with print lead Raspberry Pi-powered Anyway, keep an eye on the MagPi
times the context of these columns Christmas socials for anything I decide is
is still fairly fresh. As I’m writing Many of the Christmas tutorials that worth posting.
this, I realise we don’t have one of have appeared in the magazine over
my seasonal features in this issue the years are based on projects I’ve Under the tree
for Christmas – my favourite winter Hopefully you’ll have made use of
holiday! I’m Mr Mince Pie according
to my friends, after all.
Many of the Z`] ;]TZ]T_d-ZL]OTYRZʬP]_ZRP_L
Raspberry Pi 5 for yourself or
(Don’t tell anyone, but I might Christmas tutorials someone else who will be opening it
enjoy writing the annual Halloween on Christmas morning. If you’re
feature a little more as I get to that have appeared WZZVTYRQZ]^_ZNVTYR^_`ʬP]^_SP
embrace my inner crypt keeper and :ʯNTLW3LYOMZZV is a great gift,
alliterate more than is advisable.) in the magazine along with the newly updated
Lucy, MagPi0OT_Z]ʭ]XWdMPWTPaP^
that Christmas can’t start until after
over the years are Beginners Guide. We work hard on
those to make them extra special, and
-ZYʭ]P9TRS_FTɪX]TRS_ɧ0OHLYO
while I understand and respect that,
based on projects they’re a great way for new users to
pick up Raspberry Pi.
I’m full on Christmas mode the I’ve built myself Anyway, have a great holiday and a
moment the clocks turn midnight on happy new year. And yes, we do have
Halloween. Which, if we were to write built myself as Christmas another issue out between now and
a Christmas projects feature, would decorations, although I unfortunately then. The print industry is odd.
have been roughly the deadline for it. broke the 3D-printed star I made
That’s weird, right? I know TV shows XLYddPL]^LRZ4ɪX_]dTYR_ZʭR`]P
Rob Zwetsloot
AUTHOR

_PYO_ZʭWX_SPT].S]T^_XL^^[PNTLW^ out what to do this year, and I think


in July and It’s a Wonderful Life was I’m long overdue a Pico overhaul of
By the end of October, Rob has consumed
shot during an unusually hot summer some of my lights around my home. more mince pies than most people eat in
with everyone in big coats being Maybe it’s time to make a new star a year. He’s currently considering making
pelted by newly-invented fake snow, ornament? I do need to go back and Ec(LVMWXQEWGEOI

but it’s still a little odd to be writing make the star itself a lot lighter, as I magpi.cc

98 magpi.cc Christmas with Raspberry Pi 5


The new case from the HiPi.io team

Rapid tool-free assembly and disassembly Secure microSD card cover


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

Available at these great Pi stores:

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


.BOBHFZPVSTFSWFSTPS
XPSLTUBUJPOTSFNPUFMZ

"DPTUFŗFDUJWFTPMVUJPOGPSEBUBDFOUFST 
*5EFQBSUNFOUTPSSFNPUFNBDIJOFT

1J,7.)"5
GPS%*:BOEDVTUPNQSPKFDUT 1SF"TTFNCMFEWFSTJPO

3FBMUJNFDMPDLXJUISFDIBSHFBCMFTVQFSDBQBDJUPS 0-&%%JTQMBZ #PPUBCMFWJSUVBM$%30.


ŚBTIESJWF 4FSJBMDPOTPMF 0QFOTPVSDF"1*JOUFHSBUJPO 0QFOTPVSDFTPGUXBSF

$YDLODEOHDWWKHPDLQ5DVSEHUU\3LUHVHOOHUV

3FTFMMFSTVHHFTUJPOTBOEJORVJSJFT
XIPMFTBMF!IJQJJP

You might also like