Professional Documents
Culture Documents
CC/STORE
LD
O
I
0 L E G
U
TOP 1
B
E CT S
PROJ
KE &
M TH ZERO
A 2
W I
E R RY PI
RA SPB AS
RIST M
CH TS
E C
PROJ
LO C K
OV ERC RO 2
PI Z
W
E
R RY
BE
RASP magpi.cc/store
WELCOME
to The MagPi 112
I
’m a big fan of inquisitive people. Especially when it
comes to messing around inside computers. After all, being
inquisitive about computers is a big part of the Raspberry
Pi experience.
I’ve just spent the last couple of days overclocking the Lucy
EDITOR
Raspberry Pi Zero 2 W computer (page 52). With a cooling case Hattersley
and a couple of lines of code; an intrepid editor can get it running Lucy is editor of
The MagPi and
from 1GHz to 1.4GHz. A pretty nifty upgrade. she’s using hot-
water bottles and a
Zero 2 W is an incredible new computer. We’ve scoured every cat to keep warm.
Not sure either
project from the last couple of years that involved Raspberry Pi ƵŅƚĬÚÆåĹåĀƋüųŅĵ
Zero. The result is 40 incredible projects in our Make & Build with Raspberry Pi Zero 2
W, but she’s open to
Zero 2 (page 34). suggestions.
magpi.cc
The last twelve months have been a wild ride on The MagPi
magazine. We’ve had Raspberry Pi 400, Raspberry Pi Pico, and
Udvsehuu|#Sl#]hur#5#Z1#Doo#lqfuhgleo|#glļhuhqw#dqg#lqwhuhvwlqj#
products that help us understand computers a little better.
GE
As we head into the end of the year, few members of the team RASPBT A
get excited about winter as PI ZER ERRY
O2W
much as Rob. His Raspberry Pi
PAGE
Christmas feature (page 63) is 32
packed with projects for the
festive season.
Merry Christmas and
stay inquisitive.
magpi.cc 03
CONTENTS
Contents
> Issue 112 > December 2021
Cover Feature
34
34 Make & Build
with Zero 2
Regulars
92 Your Letters
97 Next Month
98 The Final Word
Project Showcases
08 Robot Arm Clock
12 Aston Martin DB5 Junior
16 Droiid
20 Honeycomb Wall Shelf 24
22 Pomelo
24 Automatic Dog Ball Launcher
26 Finn Feeder
28 Live CTA Railway Map
16
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 ÏŅƴåųĜĹč ĵ±ĹƼ Ņü ƋĘå ƋŅŞĜÏŸ ĜĹ Ęå a±č{Ĝ ĵ±č±DŽĜĹå ±ųå ÚĜüüåųåĹƋ ÆåƋƵååĹ ÏŅƚĹƋųĜåŸØ ±ĹÚ ±ųå ±ĬƵ±ƼŸ ŸƚÆģåÏƋ ƋŅ ÏʱĹčåţ ¥Ņƚ ±ųå ųåŸŞŅĹŸĜÆĬå üŅų ƚĹÚåųŸƋ±ĹÚĜĹč ƋĘå
ųåŧƚĜųåĵåĹƋŸĜĹƼŅƚųjurisdiction and ensuring that you comply with them. Some manufacturers place limits on the use of their hardware which some projects or suggestions in The
MagPi magazine may go beyond. It is your responsibility to understand the manufacturer’s limits.
magpi.cc 05
CONTENTS
Tutorials 48 56
44 Raspberry Pi Build HAT
48 Sensory world - part 2
52 Overclock Raspberry Pi Zero 2 W
56 Ultimate home server - part 5
60 Touch inputs on Raspberry Pi Pico
Sensory World - part 2 Ultimate home server - part 5
Reviews
86
72 Midas display
74 PicoSystem
76 UPS HAT for Zero WH
78 3.7” e-Ink display for Pico
80 Top Ten LEGO® projects
83 Learn: Circuit design
Community
86 Dr Footleg interview
88 This Month in Raspberry Pi Dr Footleg interview
95
RASPBERRY PI ZERO 2 W AND
WIN FLIRC RASPBERRY PI
1 OF 10
ZERO CASE BUNDLES!
06 magpi.cc
Claim your exclusive discount code
¦DIY15 at pi-top.com/MagPi
The Ultimate
Holiday Gift Guide
Perfect for experienced Raspberry Pi users
or people just getting started! The pi-top
[4] DIY Edition has everything you need to
begin making, tinkering, and building super
cool projects.
More than just a case, this Kit The perfect gift for someone No soldering, tools or tech The ultimate gift, and everything you
takes your Pi to the next level. looking to get started with Pi. knowledge needed! This kit need to become a project master.
gives you everything needed
With a 5 hour battery, speaker, This Kit includes the best Pi to build your own computer. Start with the perfect Raspberry
cooling system, and OLED screen case, and an electronics kit full Pi case, Touchscreen Display and
(to name just a few features), of sensors, LEDs, buttons and Use your computer to create Bluetooth Keyboard. Then add
the Maker Kit not only protects potentiometers! Use Further (our fun Pi projects and then simply sensors, lights, and LEDs galore
your Pi, it allows you to take your Online Project Library) and get power it down and take it ,"7-3a0#-o@&#-,*7*'+'2'1
projects with you - anywhere. started coding cool projects. with you! your imagination.
*Raspberry Pi 4 not included. o#003,13,2'*Ù×@×Ø@ØÖØ×@1. #007''120"#+0)-$2. #007' -3,"2'-,@ © CEED Ltd. 2021
Robot
Arm Clock
A deliberately over-engineered timepiece
provided a satisfying distraction for a busy
software engineer, learns Rosie Hattersley
L
ike many of us, 33-year-old software engineer
Hendrik Ohrens likes to combine the technical
skills he uses for work with those he’s picked
up through his hobbies, to come up with something
creative. “I love working on projects that involve
electronics, mechanics, and software,” he says of his
enthusiasm for making things. With a background in
vflhqwlĽf#uhvhdufk#dqg#phfkdqlfdo#hqjlqhhulqj#dw#wkh#
Hendrik
MAKER
Quick FACTS
> Hendrik allows his
projects to take
shape organically
> He trained
it to chase a
rubber duck
Sketching it out
Hendrik prefers to sketch out plans and adapt
them as needed, rather than starting with a rigid
design. For his robot arm, he started with some
servos and a basic CAD model that would be easy
to 3D-print and add small parts to. Once he was
Arm yourself
eƋƋ±ÏʱĹÚĜĹŸƋ±ĬĬ±%ƼűĵĜƻåĬĘĜåĬÚ±ĹÚ
02 eųÚƚĜĹŅaUØƋĘåĹā±ŸĘÚƼűĵĜƻåĬƣ±ŞĜüųŅĵ
the code/arduinoüŅĬÚåųƋŅƼŅƚųeųÚƚĜĹŅţ¥Ņƚ±ĬŸŅ
ĹååÚƋŅŸåƋƚޱĹÚĜĹŸƋ±ĬĬ{ƼƋĘŅĹƐ±ĹÚĜĩŞƼĬĜÆŅĹ
ƼŅƚų±ŸŞÆåųųƼ{Ĝ±ĹÚ±ƋƋ±ÏʱŞŅƵåųŸƚŞŞĬƼţ
happy with the basic design, he simply duplicated Teaching the robot arm
which position to adopt
it to make additional movable parts and chained involved demonstrating
the servos using a cable. each pose
Wkh#urerwġv#dup#qhhghg#wr#eh#prxqwhg#wr#
prevent it toppling over, so Hendrik 3D-printed
fodpsv#khġg#irxqg#rq#Wklqjlyhuvh/#dqg#fodpshg#
the arm to the table. He then glued the broken
clock (whose dials the robot arm would move) to a
zrrghq#er{/#zklfk#kh#dovr#wkhq#joxhg#wr#wkh#wdeoh#
vr#lw#zrxogqġw#exgjh1#Diwhu#vrph#dgmxvwphqwv#wr#
wkh#dupġv#pryhphqw/#zklfk#vtxhdnhg#ehfdxvh#
ƚĜĬÚƋĘåųŅÆŅƋ±ųĵÆƼŞƚƋƋĜĹč±ŸåųƴŅĜĹ
it slightly overlapped in places, Hendrik began 03 the base; screw the base_element on to it,
the far lengthier process of training the robot
üŅĬĬŅƵåÚƤÆƼƋĘå±ųĵƣåĬåĵåĹƋŸţĬ±ĵŞƋĘåƱŸåƋŅ
which position to adopt when. Having created a table or something solid, otherwise the arm will
wkh#vrphzkdw#h{sdqghg#prwlrq0frqwuro#frgh/#kh# ü±ĬĬţƤ8ŅųÏŅĵŞĬåƋåŸåƋƚŞÚåƋ±ĜĬŸ±ĹÚÏŅÚåØŸåå×
says the robot arm could be used for any sort of github.com/devdrik/robo-arm.
Raspberry Pi project he likes.
Aston Martin
DB5 Junior A faithful replica of the
Aston Martin DB5, and
ŅüƋĘåĀĬĵŞųŅŞŸ±ŸƵåĬĬ
To make an authentic James Bond-style Aston
Martin, the only choice was a Raspberry Pi.
Rob Zwetsloot casts a GoldenEye over it
O
ne of the most iconic cars in cinema
history, the Aston Martin DB5 remains
extremely cool to this day – even without
the many enhancements that Q installed into
James Bond’s vehicle. A real Aston Martin DB5 will
set you back an unimaginable amount of money,
and won’t even have changing number-plates as
standard. If you’re happy with something a little
Simon
MAKER
Quick FACTS
> Raspberry Pi is
used to test other
cars at The Little
Car Company
> ĘååƻƋų±ÚųĜƴĜĹč
modes are:
cŅƴĜÏåØ)ƻŞåųƋØ
Competition,
Escape
ĘåĹƚĵÆåųěŞĬ±ƋåĜŸ±ÚĜčĜƋ±Ĭ
ŸÏųååĹƋʱƋ±ŸŞÆåųųƼ{ĜÏ±Ĺ > There’s an
ŸƵĜƋÏĘƋĘåĹƚĵÆåųŸŅĹ hour’s worth of
smokescreen in
the tank between
top-ups
BĜÚÚåĹĵĜĹĜčƚĹŸĬƚųĩÆåĘĜĹÚƋĘå
Ęå±ÚĬĜčĘƋŸØųå±ÚƼƋŅÆå±ÏƋĜƴ±ƋåÚ
Alternative number-plate 1
All systems go
Licence to thrill
It’s a fairly simple setup, requiring a Raspberry
Pi 4, an I/O extender, and some timer chips –
although Raspberry Pi can handle much more
than it’s used for.
“As a demonstration of the system’s
capabilities, I coded it to show the movie trailer
on the front screen when the licence plate button
was pressed and held,” Simon mentions. “This
included playing the audio too. It also played the
audio of a theme tune when another button was
pressed and held.”
The car has appeared on TV in the UK and in
When the gun is activated, the headlights are
the USA, and according to Simon, it’s the most 03 ųåƋų±ÏƋåÚرĹÚƵĘåĹƋʱƋĜŸÏŅĹĀųĵåÚØƋĘå
interest they’ve ever had for a product. relays will activate to present the guns, stopping at the
You can also get a regular version of the DB5 maximum swing. The same happens in reverse, with
Junior if you don’t fancy the extra gadgets, but ƋĘåčƚĹŸÏŅĹĀųĵåÚŸƋŅųåÚÆåüŅųåƋĘåĬĜčĘƋŸųåƋƚųĹţ
where’s the fun in that?
Droiid –
A Package
Droiid is equipped with a mic and
speaker for its audio capabilities,
including text-to-speech
Delivery
Robot
Here’s an autonomous, efficient bot who’ll deliver goodies
to your doorstep. Nicola King waits for her order…
I
nspired by the likes of Amazon and Starship, two
companies that have both created six-wheeled
delivery robots (magpi.cc/amazonscout and
starship.xyz), UK-based Eben Kouao wondered if he
could possibly build a similar vehicle. As powerful
mini-computers become more accessible, Eben
started building his own version with a Raspberry Pi
and an Arduino, and the result of his labours is Droiid,
Eben Kouao
MAKER
Quick FACTS
> 3D-printing the
various parts at a
ĉLjŢĜĹĀĬĬƋŅŅĩ)ÆåĹ
Ņƴåų±Ƶååĩ
Controlling Droiid
Using the livestream chat in YouTube or Twitch,
Droiid can be instructed to move or say something.
Honeycomb
Wall Shelf
David Crookes discovers how Raspberry Pi can shine a whole
The shelf displaying a Doctor
new light on even the most everyday of household items Who and TARDIS model
H
aving recently married, Jason and Jessie vroxwlrqv#dqg#oleudulhv/#dqg#pdnh#xvh#ri#wkh#JSLRv#
Logan decided it was time to put their zlwkrxw#ohdylqj#wkh#ode/Ĥ#kh#h{sodlqv#ri#wkh#ehqhĽw#
vwdps#rq#wkhlu#Ľuvw#krph1 “We wanted of using this particular model early in the build.
something that would really be unique,” Jason “Then, when it’s all ironed out, you can drop the
says. “And some shelves for the living room to program on to a Raspberry Pi Zero or Raspberry Pi
display our adventures and interests seemed like Slfr#wr#jdlq#hĿflhqf|#dqg#vdyh#vrph#frlq1Ĥ
the right concept.” To get things up and running with a set of 12 V
Rather than opt for basic horizontal shelving, RGB light strips, they used pulse-width modulation,
Jason and
MAKER
however, the newlywed couple settled on which is a common way of controlling the dimming
Jessie Logan a hexagonal design. “Jessie set about with ri#UJE#OHGv1#Lw#phdqw#wkh#surmhfw#frxog#dgmxvw#krz#
construction paper making templates and much red, green, or blue is being displayed.
Jason and
Jessie seek new rearranging them on the wall until we were
experiences with vdwlvĽhg/Ĥ#Mdvrq#frqwlqxhv1#ģL#wkhq#zdqwhg#wkhp#
wanton abandon in
New Hampshire, and
to light up.” We plan to use touchpads
Lw#zdv#wklv#ghflvlrq#wkdw#wrrn#wkh#surmhfw#wr#wkh#
the universe at large.
next level, creating an eye-catching set of shining printed in Gallifreyan
shelves. Although the couple says 3D printing was
perhaps a bit ambitious, outputting the six pieces
for each individual shelf on their Crealty Ender 5 Time to improve
Pro 3D printer put the couple in control. “Printing “Since Raspberry Pi can only control a 3.3 V circuit
them allowed for all of the elements we needed, in this manner, we used three NPN transistors
while not overburdening the drywall.” dqg#wkuhh#LUI]77Q#PRVIHWv#wr#vwhs#lw#xs#wr#8#Y/#
and then to the 12 V that the light strip uses,” says
Pieces of six Mdvrq/#zkr#dggv#wkdw#ohduqlqj#wr#vl}h#wkh#PRVIHWv#
Each of the six pieces incorporates a channel that surshuo|#iru#wkh#mre#zdv#wkh#eljjhvw#fkdoohqjh1#ģLw#
allows the lights to shine and the idea was to glue taught us a lot about gating and output curves.”
each part together to form the hexagonal shapes. The result was worth the perseverance, however,
ģZh#dovr#fuhdwhg#vwdqgrļv/#vrph#ri#zklfk#zhuh# and now the couple want to go even further while
hollow to allow for chasing wires into the wall, and adding an extra-special, personal twist. They are
others that could be used with toggle anchors or both fans of Doctor Who and they want to tap into
wood screws in case of a pesky stud,” Jason says. the Gallifreyan language used by the Time Lords.
Since the couple wanted the lights to dim and “We plan to use touchpads printed in Gallifreyan
change colour, they decided to use a Raspberry coated in conductive ink as controls on the wall,”
Pi 4 computer to control the whole set of shelves. Mdvrq#uhyhdov1#ģZh#mxvw#qhhg#wr#lurq#rxw#vrph#
“You can program, debug, search the internet for sensitivity issues.”
I±ŸŅĹűŸŞųŅčų±ĵüŅų±ŸŞÆåųųƼ{Ĝ
ÏƼÏĬåŸƋĘųŅƚčĘƋĘåÏŅĬŅƚųŸŅüƋĘå
ų±ĜĹÆŅƵåƴåųƼƐLjŸåÏŅĹÚŸŅųŸŅ
Quick FACTS
> The shelves took
82 days to print
Pomelo
A robot dog aimed at education for younger kids learning code.
Rob Zwetsloot finds out just how good a doggo it is
R
obot pets have been around for a long
time. Raspberry Pi-powered ones, not so
much though. While there are currently no
Aibo-a-likes walking around people’s houses, that
lv#suredeo|#qrw#wrr#idu#rļ1#Srphor#lv#d#orrn#dw#zkdw#
pljkw#eh/#doehlw#zlwk#dq#hgxfdwlrqdo#ohdqlqj1
ģSrphor#lv#d#grj0vkdshg#hgxfdwlrqdo#wr|#urerw#
wkdw#lv#vxlwdeoh#iru#sulpdu|#vfkrro#fodvvurrpv/#zlwk#
Yoel Nasi wkh#jrdo#ri#surprwlqj#vwurqj#dojrulwkplf#vnloov#lq#
MAKER
22 magpi.cc Pomelo
PROJECT SHOWCASE
Quick FACTS
> The head can move
up and down
The 3D-printable
ĀĬ埱ųå±ƴ±ĜĬ±ÆĬå
> Pomelo is Spanish
for anyone to use
for grapefruit
Pomelo magpi.cc 23
PROJECT SHOWCASE
Automatic Dog
Ball Launcher
Are your games of fetch with your pooch leaving you panting?
David Crookes catches up with a Raspberry Pi Pico solution
D
ogs love to play fetch and it’s a wonderful just wanted to try something new,” he says. “I love
way to exercise your pooch. Trouble how simple it is to program.”
is, constant ball throwing isn’t half
exhausting for human arms, which is perhaps Print perfect
why there’s a growing number of automatic ball Before getting down to coding, however, he spent
launchers on the market. time experimenting. “I started with the motor
Rather than buy one of those, however, seasoned mount to test if that would launch the balls,” he
maker Brankly has created one of his own. “My dog explains. “After that, I designed the other parts
Brankly
MAKER
loves to play with blue toy balls and I wanted him and, in the end, the case. I played around with
to have a little more fun,” he tells us. “I also want glļhuhqw#vkdshv#dqg#irxqg#wkdw#d#vskhuh#ghvljq#
Brankly is an inventor
and entrepreneur. He him to be able to play fetch when we are busy by looked the best. It was also small enough for my 3D
grew up in Germany encouraging him to load the balls himself.” printer to print.”
and worked as an IT
While training his dog to do so is still ongoing, The case was designed in Fusion 360. “I like 3D
consultant for years
before following his work on the ball launcher is complete. It makes sulqwlqj#ehfdxvh#|rx#fdq#ghvljq#hyhu|wklqj#Ľuvw/#
passion for inventing use of a Raspberry Pi Pico microcontroller board send it to the printer, and have the part after
full-time. which is something of a departure for Brankly who some hours,” Brankly says. “Most of the time,
magpi.cc/dogball has previously used Arduinos for his projects. “I you have to change small parts, but it’s a pretty
vwudljkwiruzdug#surfhvv1Ĥ#Lqghhg/#kh#uhĽqhg#wkh#
project as he went along, such as the rollers that
accelerate the ball.
ģWkh#Ľuvw#yhuvlrq#kdg#d#surĽoh#sulqwhg#rq#wkhp/#
but the friction was not enough to grab the ball
when it was wet from my dog’s saliva,” Brankly
says. “I also had to change the mount for the
vhqvru#d#frxsoh#ri#wlphv#ehfdxvh#wkh#Ľuvw#wzr#
sensors I tried didn’t work.”
And fetch
So how does the launcher work? When a ball is
placed into its funnel, it is prevented from falling
into the launch channel by a piece of plastic that’s
controlled using an SG90 servo. The ball is then
detected by a sensor, prompting Raspberry Pi Pico to
get ready for launch.
“I used a motor controller to be able to randomise
Brankly says the
limitations of his 3D the speed of the motors with a pulse-width
printer meant the modulation (PWM) signal,” explains Brankly. “For
components had to
be cramped into the each cycle, Raspberry Pi Pico generates a random
case more than he’d
number between 40,000 and 65,000, and this gets
have liked
sent to the controller as a PWM value.
Quick FACTS
to be able to randomise
centre of the image soft balls
Finn Feeder
One maker and his son are making sure the fish they buy will never go hungry
with a project that’s going swimmingly well, as David Crookes discovers
W
hen Ryan M Haas’s son asked if he dvvhpeo|/#dqg#sduw0doljqphqw#iru#wkh#Ľwwlqj#ri#
frxog#kdyh#d#Ľvk#wdqn/#lw#txlfno|# wkh#vfuhzv/Ĥ#U|dq#vd|v1
ehfdph#fohdu#wkhuh#zrxog#eh#d#sureohp1 ģL#dovr#ghflghg#wr#xvh#Udvsehuu|#Sl#]hur#Z#
“We’re away from home a lot, so I knew there was ehfdxvh#lw#Ľwv#doo#ri#p|#ghvljq#uhtxluhphqwv1#
d#srvvlelolw|#wkh#Ľvk#zrxog#jr#orqj#shulrgv#zlwkrxw# L#qhhghg#d#zd|#wr#frqwuro#wkh#vhuyr#dqg#wkh#
ehlqj#ihg/Ĥ#U|dq#vd|v1#\hw#kh#glgqġw#zdqw#wr#ghq|# ľh{lelolw|#wr#dgmxvw#wkh#dprxqw#ri#irrg#glvshqvhg#
klv#vrqġv#uhtxhvw1 dv#zh#dgg#pruh#Ľvk#wr#wkh#wdqn1Ĥ
Lqvwhdg/#kh#fdph#xs#zlwk#d#ģĽq0wdvwlfĤ#vroxwlrq1# Dowkrxjk#U|dqġv#vrq#grhvqġw#|hw#kdyh#dq|#
Ryan M Haas ģL#kdg#vhhq#dxwrpdwlf#shw#ihhghuv#lq#wkh#shw# Ľvk/#lghqwli|lqj#wkh#rqhv#wkh|ġg#olnh#wr#nhhs#
vwruhv/#exw#L#nqhz#L#zrxog#eh#kdsslhu#zlwk#p|# sod|hg#d#elj#sduw#lq#wkh#ghvljq1#ģRqfh#zh#jhw#wkh#
MAKER
Ryan is an
electronics and rzq#ghvljq/Ĥ#kh#whoov#xv1#ģP|#vrq#lv#dovr#hqmr|lqj# dtxdulxp#vhw#xs#zlwk#wkh#fruuhfw#zdwhu#txdolw|#dqg#
software hobbyist klv#whfkqrorj|#hgxfdwlrq#fodvvhv#lq#kljk#vfkrro1#L# whpshudwxuh/#dqg#rqfh#zh#kdyh#hvwdeolvkhg#d#vrolg#
from Pennsylvania, wkrxjkw#wklv#surmhfw#zrxog#eh#vrphwklqj#ixq#iru#xv# ohyho#ri#khdowk|#edfwhuld/#zh#sodq#rq#sxufkdvlqj#
USA. He enjoys
time with his family,
wr#zrun#rq#wrjhwkhu1Ĥ d#ydulhw|#ri#gdqlrv/#zklfk#duh#d#ydulhw|#ri#vpdoo#
as well as home Zlwk#wkdw#lq#plqg/#wkh#sdlu#jrw#wr#zrun/#zlwk# wurslfdo#Ľvk/Ĥ#U|dq#uhyhdov1
improvement U|dq#vshqglqj#wzhoyh#krxuv#sodqqlqj#wkh#surmhfwġv#
projects.
magpi.cc/
S|wkrq#frgh/#dqg#zrunlqj#rxw#wkh#gdwdedvh#
vwuxfwxuh#kh#qhhghg#wr#wudfn#wkh#ihhgv1#Kh#xvhg#d#
Ryan’s project calls on the
EYXSƤWLJIIHIV
vlqjoh#VJ<3#vhuyr#dqg#6G0sulqwhg#sduwv/#sxwwlqj#
Udvsehuu|#Sl#]hur#Z#dw#lwv#khduw1
Python script two or three
times each day
Nothing fishy
ģWklv#surmhfw#uhsuhvhqwv#p|#Ľuvw#ghvljq#ri#p|# ģWkh|#uhtxluh#irrg#wzr#wr#wkuhh#wlphv#shu#gd|#
rzq#dqg#wkhuh#zdv#d#ohduqlqj#fxuyh#rq#krz#wr# dqg#wkh#dprxqw#ri#irrg#lv#ghshqghqw#rq#wkh#
ghvljq#sduwv#iru#wkh#ehvw#sulqwlqj#txdolw|/#hdvh#ri# qxpehu#ri#Ľvk#lq#wkh#dtxdulxp1#Lw#lv#uhfrpphqghg#
ihhg#wlph1#Li#wklv#zdv#pruh#wkdq#vhyhq#krxuv# wr#hlwkhu#qr#irrg#ehlqj#glvshqvhg#ru#dq#hqwluh#
djr/#wkhq#d#fruuhfw#dprxqw#ri#irrg#lv#surpswo|# krsshuġv#zruwk#ri#irrg#ehlqj#gursshg#lqwr#wkh#
glvshqvhg#dqg#d#qhz#wlphvwdps#lv#zulwwhq1 dtxdulxp/Ĥ#kh#vd|v1#ģL#dovr#sodq#wr#dgg#d#olyh#ylghr#
ģDv#Ľvk#duh#dgghg/#wkh#grru#rshq#vl}h#dqg#rshq# vwuhdp#ri#wkh#dtxdulxp#vr#p|#vrq#fdq#zdwfk#klv#
gxudwlrq#ydoxhv#zloo#qhhg#wr#eh#dgmxvwhg/Ĥ#U|dq# kdss|#Ľvk#vzlpplqj#durxqg1Ĥ#
Railway Map
live data is fetched using the CTA’s API
W
e’ve seen a few railway-themed Raspberry
Pi projects before, including mini
departure boards, but Jordan von Mulert
has gone one step further by creating a whole
railway map – of Chicago’s ‘L’ elevated railway –
lit up with LEDs to show the positions of trains at
stations in real-time.
Jordan von Jordan was inspired to make the map after moving
MAKER
Mulert away from the Chicago, where he’d lived for ten years
with his wife. “Since moving away from the city, we
Jordan is a violin have missed the days of being able to ride the train,”
luthier turned
mechanical he reveals. “Creating this live rail map gives a real
engineer. His passion vhqvh#ri#frqqhfwlrq#wr#wkh#hee#dqg#ľrz#ri#wkh#flw|1#
is learning and I like waking up early in the AM and seeing maybe
making things. When
only a dozen trains running in the city. But as the city
not with his wife
±ĹÚĩĜÚŸØƼŅƚűĬĬĀĹÚ comes alive, more and more trains light up my map.”
him in his workshop
or exploring in
ƋĘåƤƵŅŅÚŸţ
Light up the board
Mounted on a wooden board, the map features no
fewer than 191 LEDs – one for each station – wired
individually to pins on eight 24-channel PWM LED
driver boards controlled by a Raspberry Pi Zero W.
Raspberry Pi is at the heart of the operation, as
Jordan explains. “On startup it runs my Python script
which pulls data from the CTA API about every seven
seconds. I found that more often than that doesn’t approaching station, and also to know when a train
capture any useful changes, but less often than that has left service at the end of the run, otherwise the
and you tend to get lots of changes at once.” last LED in the run would be perpetually lit.
The CTA’s API gives him a complete status of
all the trains operating in the system. “When a Web of wiring
train approaches a station, the API includes an While Raspberry Pi is the brains of the operation,
Ġdssurdfklqj#vwdwlrqġ#ľdj#iru#wkdw#wudlq/Ĥ#vd|v#Mrugdq1# Jordan tells us the eight LED drivers are the brawn
ģP|#frgh#orrnv#iru#wkhvh#ľdjv#dqg#dfwlydwhv#wkh#OHG# of it, as they control each individual LED. “I
mapped to the corresponding station.” debated for a long time as to the best way to obtain
The script will also keep track of each train along independent control of the 191 LEDs needed for
lwv#uxq#vr#wkdw#lw#nqrzv#zkhq#wr#wxuq#rļ#wkh#OHG#iru# the map,” he recounts. “Addressable LEDs were
the last station and illuminate the LED for the new dq#rswlrq/#exw#Ľqglqj#6#pp#glvfuhwh#wkurxjk0kroh#
eÏĬŅŸåěƚŞŅü±ŸŞÆåųųƼ{Ĝ¬åųŅƤ
mounted on the rear of the
map, showing the wire-wrapped
connections to its GPIO pins
In the loop
The zoomed-in view of ‘The Loop’ section of the
CTA railway caused a little extra complication, and
dovr#suhfoxghg#xvlqj#rļ0wkh0vkhoi#dgguhvvdeoh#
RGB LED string lights for the project. “Those have
5 mm LEDs which would have been too big for the
tight spacing required at each train stop,” notes
Mrugdq1#ģL#kdg#frqvlghuhg#xvh#glļhuhqw#OHGv#iru#
that section only, but I wanted the lighting to
be consistent.”
Jordan spent hours debugging code and mapping
each LED channel to the correct stop. “Electrically,
things went pretty smoothly,” he says. “I ended up
dgglqj#vrph#rswlrqdo#Ľowhu#fdsdflwruv#wr#wkh#erdugv#
to keep electrical switching noise down, and I’m
still hunting some gremlins in the SPI data lines.
But you know how it is: the reward is the journey,
not the end product.”
Making a map
Creating a railway map with holes for the LEDs to
light it up.
SUBSCRIBE TODAY
FROM ONLY £5
Subscriber Benefits
FREE Delivery
Get it fast and for FREE
Exclusive Offers
Great gifts, offers, and discounts
Great Savings
Save up to 35% compared to stores
Subscribe in print
WORTH
$15
today and get a
FREE computer!
A full Raspberry
Pi desktop
computer
SUBSCRIBE
on app stores
magpi.cc 33
FEATURE
R E E !
F 2 W S
E R O RI B ER
Z C
D
BS
L
U
FOR S GE 32
S E E P A
& BUI
KE
M TH ZERO
A 2
W I O V ER 4 0 I NC
P
RE
R O
D
J E
I
C
B
T
LE
S .
DIS C 2 W S L E Y
Z ER O T T E R
RY P I I E H A
P B E R R O S
R A S B Y
B
oasting a quad-core processor running
dw#4JK}/dqg#zlwk#xs#wr#Ľyh#wlphv#wkh#
processing power of its predecessor, yet
zlwk#h{dfwo|#wkh#vdph#irrwsulqw/#Udvsehuu|#Sl#
]hur#5#Z#lv#d#juhdw#vlqjoh0erdug#frpsxwhu#wr#
exlog#surmhfwv#zlwk1 The tiny new computer was
given away – worldwide – as a free gift to all print
dqg#vxevfulswlrq#uhdghuv#ri#wklv#Ľqh#sxeolfdwlrq1#
And new subscribers can pick up a free Zero 2 W
with a 12-month subscription to The MagPi
(pdjsl1ff2vxevfuleh,1
The $15 wonder is a new and improved entry-
level Raspberry Pi model, making good on
Raspberry Pi’s continuing aim to get the power of
computing into the hands of just about everyone,
whdulqj#grzq#eduulhuv#ri#frvw#dqg#jhrjudsk|1#
]hur#5#Z#uhsuhvhqwv#d#vljqlĽfdqw#shuirupdqfh#
boost, should you be thinking of simply updating
dq#h{lvwlqj#Udvsehuu|#Sl#]hur#Z#surmhfw1#Iru#prvw#
people, however, the launch of this diminutive but
incredibly able single-board computer is an excuse
wr#ehjlq#d#zkroh#qhz#Udvsehuu|#Sl#surmhfw1#Khuh/#
then, are 40 suggestions of ways to make use of
|rxu#Udvsehuu|#Sl#]hur#5#Z1
PROJECTS
STARTER Prepare your
workspace
You’ll need a soldering iron
and either lead-based or
lead-free solder. Declutter
Warning!
Raspberry Pi PC Challenge
your workspace, open a
Hot solder!
01 window to provide ventilation,
and don protective gloves
Soldering irons get very
and goggles. Attach a 2×20- hot, and stay hot for a
Zlwk#d#4JK}#txdg0fruh#surfhvvru/#Udvsehuu|#Sl#]hur#5#Zġv#FSX#lv#hyhu|#
pin header (magpi.cc/ long time after they’re
elw#dv#srzhuixo#dv#d#Udvsehuu|#Sl#6#+doehlw#zlwk#845PE#UDP,1#Sdlu#|rxu# unplugged. Make sure
headers) to the holes on one that you put the iron in
Zero 2 W with a keyboard, mouse, and screen and it can be used as a side of Zero 2 W. You can the stand when you’re
fdsdeoh#krph#frpsxwhu1#Iru#d#frpsohwh#uxqgrzq#ri#krz#wr#xvh#|rxu#wlq|# use putty or insert Zero 2 W not using it and don’t
touch the metal parts –
new Raspberry Pi as a replacement for a much more power- and space- into a breadboard to hold it even after it’s unplugged.
kxqju|#ghvnwrs#frpsxwhu/#fkhfn#rxw#rxu#Udvsehuu|#Sl#6E.#SF#Fkdoohqjh#lq# in place. magpi.cc/soldering
Start coding
the pin and the pad are both heated up, so press the
02 iron against both while you count to three.
One big reason many people buy a Raspberry Pi is to pick up some coding
skills. And Raspberry Pi OS is packed with programming languages, tools,
projects, and tips. Beginners should start with Scratch, a visual language
that teaches object-oriented skills. Open Scratch 3 and click on Tutorials
to start. For advanced projects, including Python, click Help > Projects.
magpi.cc/learnscratch
magpi.cc/learnpython
Step 2. Apply the solder
When you’ve reached three, still keeping the iron in
03 Discover electronics place, press the end of your length of solder gently
against both the pin and pad, but on the opposite side
to your iron tip.
Using Raspberry Pi and electronics together opens up a whole world
of educational and creative possibilities (as the project showcases we
feature every issue attest). Armed with a breadboard, jumper leads,
LEDs, buzzers, resistors, and switches, you’ll be well set for a journey
to becoming an inventor. Follow our electronics guide in issue #64.
magpi.cc/64
06 Pirate Radio
Pimoroni makes some fantastic audio HATs and kits for Raspberry Pi, and
the Pirate Audio range add audio output and small screens to Raspberry Pi
]hur1#Wkh|#duh#lghdo#vwduwhu#nlwv#iru#h{sorulqj#hohfwurqlfv#dqg#frpsxwlqj#
zlwk#dq#dxglr#ehqw1#Xvh#Udvsehuu|#Sl#]hur#5#Z#wr#frqqhfw#wr#wkh#lqwhuqhw#
and tune into radio stations around the world.
magpi.cc/pirateaudio
09 CamJam EduKits
These £5 electronics kits in a tin are absolutely
fantastic! Developed by the folks at Cambridge
These £5 electronics kits are Raspberry Jam, they include breadboards,
jumper leads, resistors, lights, a buzzer, and
absolutely fantastic worksheets for coding with Python.
magpi.cc/edukit
14 Mood Light
Frglqj#vnloov#frph#wr#wkh#iruh#zlwk#wklv#Prrg#Oljkw#nlw#zklfk#fkdoohqjhv#
|rx#wr#fuhdwh#jrujhrxv#frorxu#frpelqdwlrqv#xvlqj#wkh#Xqlfruq#sKDW#dqg#
wkh#65#surjudppdeoh#QhrSl{ho#oljkwv1#Rqfh#vhw#xs/#lw#orrnv#idqwdvwlf#dv#d#
ehgurrp#oljkw/#ru#fdq#eh#xvhg#wr#vhw#wkh#prrg#gxulqj#d#sduw|1#
magpi.cc/moodlight 17Upgrade with
Zero 2 W: OctoPrint
15Pi-hole with OctoPrint is a controller for 3D printers, and
ZERO 2 W LAMP
20
Web Server
Mythic Beasts uses Linux and multiple
TUTORIALS
PROJECT
Raspberry Pi 4 computers to host websites.
Using it for a Raspberry Pi-based WordPress
blog or site is really straightforward because
it has the Raspberry Pi OS already installed.
Xvlqj#ODPS#+Olqx{/#Dsdfkh/#P|VTO/#dqg#SKS2
Shuo2S|wkrq,#vhuyhu#vriwzduh/#|rxu#zhevlwh#zloo#
18Wearable Time- be all set to welcome the world.
Lapse Camera
magpi.cc/lamp
over time
19 Time-Lapse Animations
Watching paint dry or grass grow are usually given as examples of
incredibly dull ways to waste time. Time-lapse animations give the lie
wr#wklv=#wudlq#|rxu#Udvsehuu|#Sl#]hur#5#Z#dqg#KT#Fdphud#wr#fdswxuh#krz#
a plant grows over time. Seeds growing, clouds moving, and sunrise to
sunset are all rewarding examples.
magpi.cc/timelapseanimations
Multi-Room
22
Audio System
Learn how to set up the powerful music
server Mopidy, and use Python code to play
tracks from the main streaming services to
hqmr|#dw#|rxu#ohlvxuh1#Wklv#wxwruldo#wkhq#vwhsv#
things up by making the whole shebang a
pxowl0urrp#h{shulhqfh1#
magpi.cc/multiroomaudio
23 Make a 3D Camera
\rxġoo#qhhg#wzr#Udvsehuu|#Sl#]hur#erdugv# 28Build a Low-
Cost Robot
dqg#wzr#Udvsehuu|#Sl#KT#Fdphudv#iru#
this zany tutorial, one for each eye.
Wkh#uhvxowlqj#4516PS#shu#h|hslhfh#
ylhzhu#fuhdwhv#6G#hļhfwv#e|#sodflqj# Step 1. Get the parts
the two cameras 5 cm apart to produce A plastic lunchbox, Raspberry Pi Zero W and an L298
overlapping images that simulate an controller plus some AA batteries form the basis of
lpsuhvvlyh#ghswk#ri#Ľhog1# your DIY robot. Our low-cost robot was built by Danny
Ƌ±ŞĬå±ĹÚĀųŸƋ±ŞŞå±ųåÚĜĹThe MagPi magazine issue
magpi.cc/3dcamera
#87 (magpi.cc/87).
Vsrqwdqhrxv#Udvsehuu|#Sl#idqv#zloo#olnh#wkh#frqfhsw#ri#wklv#wdnh0dq|zkhuh#
option in which a Zero 2 W is kept safely inside a 3D-printed case attached
wr#|rxu#nh|#ire/#uhdg|#iru#xvh#zkhqhyhu#wkh#qhhg#dulvhv1#Vlqfh#wkh#Z#
ghqrwhv#zluhohvv/#|rx#pljkw#xvh#lw#pruh#riwhq#wkdq#|rx#h{shfw1#
magpi.cc/zerokeyring
26 NeoPixels
Udvsehuu|#Sl#]hur#5#Z#ohqgv#lwvhoi#wr#zhdudeoh#surmhfwv#+exlogv#wkdw#|rx#fdq#
carry about with you). Our friends over at HackSpace magazine wrote a
whole book on wearable projects, and it’s packed with ideas for things you
can make (pdjsl1ff2zhdudeohsurmhfwv). Lots of projects use NeoPixels as
Step 3. Glue and wire it up
Before gluing and wiring things up, place everything
sruwdeoh#oljkwv/#zklfk#duh#d#juhdw#Ľw#iru#Udvsehuu|#Sl#]hur1#Wdnh#d#orrn#dw# ĜĹŸĜÚåƋĘåĬƚĹÏĘÆŅƻϱŸåƋŅÏŅĹĀųĵĜƋƵĜĬĬĀƋ±ĹÚ
Adafruit’s NeoPixels page for help on getting started. that you have enough leads and jumpers. Follow the
magpi.cc/neopixelspi online guide to complete the setup (magpi.cc/robot).
27 Smart Doorbell
See who’s ringing your bell before deciding whether to answer it (and if a
polite smile is needed) with this smart doorbell and video intercom project.
Zkhq#vrphrqh#duulyhv#dw#|rxu#grru/#|rx#jhw#d#qrwlĽfdwlrq#dqg#vqds#ri#wkh#
caller on your smartphone, so you can choose whether or not to respond.
magpi.cc/smartdoorbell
33 CamChess
Li#The Queen’s Gambit sparked an interest
in chess, this challenger setup may also
sltxh#|rxu#lqwhuhvw=#ghvljqhg#wr#plplf#
the experience of playing against a real
frpshwlwru/#FdpFkhvv#xvhv#wkh#VwrfnĽvk#
chess engine and records moves made on a
vwdqgdug#fkhvverdug1#
magpi.cc/camchess
DIY Hardware
31
Password Keeper
So many sites we visit these days require passwords and personal details,
that it’s tempting to use the same login for them all. A far safer option
is to use a dedicated password keeper to generate and store your logins.
Khuh/#Udvsehuu|#Sl#]hur#Z#dfwv#dv#d#vhsdudwh#SF#surylglqj#wkrvh#ghwdlov#
remotely, where keystrokes can’t be logged.
magpi.cc/passwordkeeper
36 Jazz Champion
D#uhsxusrvhg#Fkhvv#Fkdpslrq#iurp#
the 1970s becomes a musical play-
and-response game based on chord
progressions and the maker’s love of
md}}1#Lwġv#d#zrqghuixo#ghprqvwudwlrq#
of the sort of imaginative builds our
uhdghuv#fuhdwh#zlwk#Udvsehuu|#Sl#]hur#Z1
magpi.cc/jazzchampion
37 Stick PC
USB pen drives are endlessly useful, not least as a carry-with-you backup
ri#Ľohv#|rx#qhhg1#Rqh#Udvsehuu|#Sl#idq#vhw#derxw#wkh#wdvn#ri#dsso|lqj#wkh#
vdph#lghd#wr#klv#Udvsehuu|#Sl#]hur#Z/#wxuqlqj#lw#lqwr#d#XVE#vwlfn#frpsxwhu1#
Jhqlxv$#Slprurql#qrz#vhoo#d#]hur#Grqjoh#+pdjsl1ff2}hurgrqjoh) if you
want a more recent, solder-free solution.
magpi.cc/stickpc
38 Telescope 39 BOSEBerry Pi
Stargazing and Raspberry Pi go hand in hand, Lqwhuqhw#udglrv#riwhq#wdnh#d#edfn#vhdw#wr#
zkhwkhu#xvlqj#dq#KT#Fdphud#ru/#dv#lq#wklv# smart speakers, but these tend to serve up
project, using the free KStars app and a Pi d#qduurz#fkrlfh#ri#vhuylfhv#dqg#vwdwlrqv1#
]hur#Z#wr#hqdeoh#vn|0wudfnlqj#wr#eh#frqwuroohg# Wkh#ERVHEhuu|#Sl#sdluv#dq#rog#lSrg#vshdnhu#
remotely. Follow this build to give an entry-level dock with a Raspberry Pi Zero W to provide
telescope a serious upgrade for a tiny outlay. zluhohvv#frqqhfwlylw|1#Wkh#uhvxowlqj#ghylfh#
magpi.cc/telescope is in daily use and sounds great!
magpi.cc/boseberrypi
40 iPod Classic
If you’re lucky enough to be able to
lay your hands on an old iPod Classic,
xsf|foh#lw#lqwr#d#Udvsehuu|#Sl#]hur#5#Z#
streaming device complete with Spotify
playlists. Streaming your music is
eminently achievable.
magpi.cc/ipodclassic
L
Set up Raspberry Pi
ast month we introduced the new
Raspberry Pi Build HAT. This new hardware
01 Start with a fresh installation of
enables you to quickly prototype and build Raspberry Pi OS using Imager (magpi.cc/imager).
Lucy
MAKER
interesting projects with LEGO bricks. The We’re using the latest Bullseye version of the OS
Hattersley sensors and motors in the SPIKE™ portfolio work (magpi.cc/bullseye). While it’s copying the
fantastically well with Raspberry Pi. software to your microSD card, set up the Build
Lucy is editor of The
MagPi and is taking Sitting between the LEGO components and HAT. Attach the 9 mm spaces to the bottom of
a much needed Raspberry Pi is the all new Build HAT. This has the board using four screws. Unlike other HATs,
break from DIY with four connectors used to attach sensors and the chips and components are on the bottom
actual bricks.
motors, bringing your builds to life and enabling of the board (so there is space for more HATs
magpi/cc sensing input and movement. and LEGO components). The spacers protrude
We’re going to be covering LEGO builds in the from the same side as the Build HAT chips and
following editions of The MagPi, and this month components. Connect the Build HAT to the GPIO
we’re going to show you how to get started with pins on Raspberry Pi using the other four screws.
Build HAT and perform basic motor control, sense
position from motors, attach a button, and use a
sensor to detect colour.
Power up and set up
02 Power up your Raspberry Pi using either
the Build HAT Power Supply or a regular Raspberry
You’ll Need Pi power connection. For the setup process, you
should attach a keyboard, mouse, and connect to a
> Raspberry Pi display (you can connect remotely via SSH or VNC
magpi.cc/products once set up). Boot into Raspberry Pi OS and follow
> Raspberry Pi the setup instructions, connecting to your network
Build HAT and providing a custom password.
magpi.cc/buildhat
> Raspberry Pi Build
HAT Power Supply
magpi.cc/ Configuration
buildhatpower 03 When you have completed the Raspberry
> The LEGO Pi OS setup process, and rebooted, open the
Education SPIKE Udvsehuu|#Sl#FrqĽjxudwlrq#Wrro#+Phqx#A#
Prime Set 45678
Suhihuhqfhv#A#Udvsehuu|#Sl#FrqĽjxudwlrq,1#Folfn#
magpi.cc/
ĘĜŸŸŞåÏĜ±ĬĬƼÚåŸĜčĹåÚX):ka±ĩåų{Ĭ±ƋåƕĜŸƋĘåĀųŸƋ
spikeprime the Interfaces tab, and set Serial Port to Enabled
LEGO element designed to connect to something that isn’t
another piece of LEGO. A little bit of history in the making and Serial Console to Disabled.
Spin it around
06 Change line 3 of the motor.py program and
add speed=50 as an argument.
motor_a.run_for_seconds(5, speed=50)
motor_a.run_for_seconds(5, speed=-50)
The Build HAT Power Supply provides 8 V DC, 6 A output to power both
Raspberry Pi and the Build HAT, along with connected motors and sensors
Click Run again and it will run in reverse.
Credit: Chris Richardson
Bookmarks (LEGO bricks work well). Then do the same again for Top Tip
a white object. Then the code displays the colour of
Here are some webpages for you to bookmark as the objects you point the Color Sensor towards. Notification
you begin your LEGO journey:
ĘåĹƼŅƚĀųŸƋ
Build HAT documentation attach Build HAT
magpi.cc/buildhatdoc to Raspberry Pi OS
Test out other sensors
Build HAT product brief
10 This is just the start of what you can achieve
Bullseye, you may
čåƋ±ĹŅƋĜĀϱƋĜŅĹ
magpi.cc/buildhatproductbrief with the Build HAT. Over the next few issues we alert that the HAT
will look at some incredible projects and builds isn’t supported.
Build HAT Power Supply product brief that you can make with LEGO and Raspberry Pi. These will vanish
magpi.cc/powersupplyproductbrief ƵĘåĹƋĘåĀųĵƵ±ųå
In the meantime, read the documentation for the
is uploaded to
Build HAT Python library to discover more code to
Build HAT Library Build HAT (during
magpi.cc/buildhatlibrary
test out the components found in the LEGO SPIKE Step 5).
Prime education kit (magpi.cc/buildhatlibrary).
Explore the
Part 02
sensory world:
Make an intruder alarm
Catch intruders red-handed with this sound- and laser-triggered alarm
I
n this series, we are exploring some of the Iru#wklv#wxwruldo/#zhġuh#xvlqj#wkh#odvhu#vhqvru#
most commonly available sensors and their iurp#wkh#Zdyhvkduh#Vhqvruv#Sdfn/#dydlodeoh#lq#wkh#
use cases.#Iroorzlqj#odvw#prqwkġv#Ľuh#dqg#jdv# XN#iurp#Wkh#Sl#Kxw#+magpi.cc/wavesensors,/#dqg#
vdihw|#dodup/#wklv#wlph#zhġoo#xvh#vhqvruv#wr#exlog#d# dovr#vrog#vhsdudwho|/#exw#dq|#vlplodu#vhqvru#vkrxog#
Phil King glļhuhqw#nlqg#ri#dodup=#rqh#wr#ghwhfw#lqwuxghuv1 zrun#lq#d#vlplodu#zd|1
MAKER
Zkloh#wkhuh#duh#pdq|#srvvleoh#zd|v#wr#vhqvh# Lw#frqwlqxdoo|#hplwv#d#odvhu#ehdp/#dqg#lwv#uhfhlyhu#
Long-time wkh#suhvhqfh#ri#d#shuvrq#qhdue|/#lqfoxglqj#d#SLU# rqo|#ghwhfwv#d#uhľhfwhg#ehdp#ri#wkh#h{dfw#vdph#
contributor to The
prwlrq#vhqvru#ru#fdphud/#zhġoo#eh#xvlqj#d#odvhu# zdyhohqjwk#+983#qp,/#vr#lw#zrqġw#eh#wuljjhuhg#e|#
MagPi, Phil is a
freelance writer and ehdp#dqg#vrxqg#vhqvru1#Zkhq#hlwkhu#lv#wuljjhuhg/# rwkhu#ylvleoh#oljkw1#Zkhq#lw#ghwhfwv#wkh#ehdp/#lwv#
editor with a focus d#ylvxdo#dqg#dxgleoh#dohuw#zloo#jr#rļ1 gljlwdo#slq#rxwsxwv#4>#zkhq#wkh#ehdp#lv#eurnhq/#lwġv#31
on technology. Zlwk#wkh#srzhu#wxuqhg#rļ/#frqqhfw#wkh#
@philkingeditor odvhu#vhqvru#wr#Udvsehuu|#Sl#dv#lq#Figure 11#
Zhġuh#srzhulqj#lw#iurp#Udvsehuu|#Slġv#6Y6#
Connect laser sensor
Figure 1 The wiring
01 Wklqn#ri#doo#wkrvh#prylhv#zkhuh#d#vhfuhw#
slq/#jurxqglqj#lw#zlwk#d#JQG#slq#+erwk#yld#wkh#
euhdgerdug#vlgh#udlov,/#dqg#wkh#gljlwdo#rxwsxw#
diagram for the
complete alarm
djhqw#ru#wklhi#kdv#wr#jhw#sdvw#vrph#odvhuv#jxduglqj# +pdunhg#GRXW#rq#wkh#vhqvru,#lv#jrlqj#wr#JSLR#541
system, including laser dq#remhfw=#euhdn#wkh#ehdp#dqg#wkh#dodup#zloo#jr#
and sound sensors,
LED, and buzzer rļ1#Wkdwġv#zkdw#zhġoo#eh#grlqj#khuh1
Laser positioning
02 Zlwk#wkh#odvhu#vhqvru#zluhg#xs/#wxuq#rq#
Udvsehuu|#Sl1#\rx#vkrxog#vhh#wkh#vhqvruġv#uhg#
srzhu#OHG#+rq#wkh#uljkw,#oljkw#xs#li#lwġv#frqqhfwhg#
fruuhfwo|1#Lw#vkrxog#dovr#eh#hplwwlqj#d#odvhu#ehdp#
iurp#wkh#phwdo#wxeh/#vr#eh#fduhixo#qhyhu#wr#orrn#
vwudljkw#lqwr#lw1
Dlp#wkh#ehdp#dw#d#qhdue|#zdoo#+xs#wr#418#p#dzd|,#
dqg#fkhfn#wkdw#lwv#ohiw#OHG#+pdunhg#GDW,#lv#olw/#
frqĽuplqj#wkdw#lw#lv#ghwhfwlqj#wkh#odvhu#ehdp1#\rx#
pd|#qhhg#wr#dgmxvw#wkh#yhuwlfdo#dqg#krul}rqwdo#wlow#
ri#wkh#vhqvru/#ru#pryh#lw#forvhu#wr#wkh#zdoo1Iru#wkh#
Ľqlvkhg#dodup/#zh#uhfrpphqg#|rx#sodfh#wkh#odvhu#
vhqvru#idluo|#qhdu#wkh#ľrru#vr#wkdw#dq|rqh#zdonlqj#
wkurxjk#lw#zloo#euhdn#wkh#ehdp#dqg#lw#zrqġw#eh#
dq|zkhuh#qhdu#wkhlu#h|hv1
DOWNLOAD
THE FULL CODE:
magpi.cc/github
Laser test
03 Wr#ehjlq/#zhġoo#fuhdwh#d#vlpsoh#S|wkrq#
wkh#vhqvru1#Hyhq#li#wkh#GDW#OHG#rqo|#ľlfnhuv#rļ#
prphqwdulo|/#wkdw#vkrxog#eh#hqrxjk#wr#wuljjhu#rxu# You’ll Need
surjudp/#dv#lq#wkh#laser_test.py#olvwlqj/#wr#uhdg#wkh# dodup#odwhu1
> Laser sensor
vhqvruġv#gljlwdo#rxwsxw#dqg#sulqw#rxw#d#phvvdjh#wr# magpi.cc/
vkrz#zkhq#wkh#ehdp#lv#eurnhq1#Iurp#wkh#ghvnwrs# lasersensor
phqx/#jr#wr#Surjudpplqj#dqg#rshq#wkh#Wkrqq|#
> Sound sensor
Add a sound sensor
LGH#wr#vwduw#frglqj1
04 Qrz#wkdw#zh#kdyh#rxu#odvhu#vhqvru#zrunlqj/#
magpi.cc/
soundsensor
your hand and see if the vrxqg#vhqvru#iru#wklv/#dv#ihdwxuhg#lq#wkh#Vhqvruv# > Active piezo buzzer
Sdfn/#exw#rwkhu#vlplodu#vhqvruv#duh#dydlodeoh/# > Jumper wires
message changes dorqj#zlwk#XVE#plfv1
Rxu#vhqvru#kdv#slqv#iru#dqdorjxh#dqg#gljlwdo#
Dv#ehiruh/#zhġuh#xvlqj#wkh#JSLR#]hur#oleudu|>#dw# rxwsxwv/#exw#zh#rqo|#qhhg#wkh#gljlwdo#rxwsxw#iru#
wkh#wrs#ri#wkh#frgh/#zh#lpsruw#wkh#Exwwrq#phwkrg# rxu#dodup1#Zlwk#wkh#srzhu#wxuqhg#rļ/#zh#frqqhfw#
iurp#lw1#Zhġoo#xvh#wklv#wr#vhqvh#zkhq#wkh#gljlwdo# wkdw#slq#+GRXW,#wr#JSLR#47/#dqg#wkh#YFF#dqg#JQF#
rxwsxw#iurp#wkh#vhqvru#lv#kljk/#lq#hļhfw#wkh# slqv#wr#6Y6#dqg#JQG#+vkduhg#zlwk#wkh#odvhu#vhqvru#
htxlydohqw#ri#d#sxvk0exwwrq#ehlqj#suhvvhg1#Dv#lwġv# yld#wkh#euhdgerdug#vlgh#udlov,/#dv#lq#Figure 11
frqqhfwhg#wr#JSLR#54/#zh#dvvljq#wkh#odvhu#remhfw#wr# Wxuqlqj#Udvsehuu|#Sl#edfn#rq/#|rxġoo#vhh#wkh#
this with laser = Button(21)1 srzhu#OHG#rq#wkh#ohiw#ri#wkh#vrxqg#vhqvru#lv#olw#xs1#
Lq#dq#lqĽqlwh#while True:#orrs/#zh#fkhfn# Pdnh#d#orxg#qrlvh#dqg#|rx#vkrxog#vhh#wkh#OHG#rq#
zkhwkhu#wkh#slq#lv#orz#+if laser.value == 0,/# wkh#uljkw#oljkw#xs#wr#vkrz#lw#kdv#ehhq#ghwhfwhg1
zklfk#phdqv#wkh#ehdp#kdv#ehhq#eurnhq/#dqg#
Danger!
vhw#wkh#phvvdjh#+msg1#yduldeoh,#wkdw#zhġoo#eh#
Laser
sulqwlqj#wr#wkh#Vkhoo#duhd#dffruglqjo|1#Lq#rxu#sulqw#
Sound test
vwdwhphqw/#zh#dgg#wkh#end = "\r"#sdudphwhu#vr#wkh#
phvvdjh#lv#dozd|v#sulqwhg#rq#wkh#vdph#olqh1
05 Ohwġv#fuhdwh#d#vlplodu#surjudp#wr#whvw#wkh#
The laser sensor used
here continually emits
a laser beam. Be very
Uxq#wkh#laser_test.py#frgh#dqg#wkhq#wu|# vhqvru1#Lq#wkh#sound_test.py#frgh#olvwlqj/#zh# careful not to point it
towards anyone’s head
euhdnlqj#wkh#ehdp#zlwk#|rxu#kdqg#dqg#vhh#li#wkh# dvvljq#wkh#sound#remhfw#wr#JSLR47#zlwk#sound = as it could potentially
phvvdjh#fkdqjhv#wr#ĠLqwuxghu$ġ1#\rx#pd|#Ľqg#wkdw# Button(14)1#Djdlq/#zh#xvh#wkh#Exwwrq#phwkrg#wr# damage their eyesight.
sound_test.py
Wklv#wlph#lq#rxu#while True:#orrs/#zh#whvw# > Language: Python
Top Tip zkhwkhu#wkh#slq#lv#kljk#+wkhuh#lv#d#orxg#hqrxjk#
qrlvh#wr#wuljjhu#wkh#vrxqg#vhqvru,1#Dv#ehiruh/#wklv# 001. from gpiozero import Button
Off board ghwhuplqhv#zklfk#phvvdjh#+lq#wkh#msg1#yduldeoh,# 002.
lv#sulqwhg#wr#wkh#Vkhoo#duhd1 003. sound = Button(14)
We’ve placed our 004. msg = ""
sensors on the 005.
breadboard, but 006. while True:
you could keep
Make a noise
them separate
from the other
06 Qrz#lwġv#wlph#wr#whvw#rxu#vrxqg#vhqvru#wr#
007.
008.
if sound.value == 1:
msg = "Intruder!"
components and fkhfn#lwġv#zluhg#xs#dqg#zrunlqj#fruuhfwo|1#Uxq#wkh# 009. else:
wire their digital sound_test.py#S|wkrq#frgh#dqg#wkhq#pdgh#d#orxg# 010. msg = "All clear"
outputs directly qrlvh#wr#pdnh#wkh#GDW#OHG#rq#wkh#uljkw#ri#wkh# 011. print(msg, end = "\r")
to the GPIO pins. vhqvru#oljkw#xs1#\rx#pd|#Ľqg#wkdw#|rx#qhhg#wr#eh#
It’s best to keep
qrlv|#iru#d#vhfrqg#ru#vr#dqg#wkdw#wkhuhġv#d#vkruw#
the laser sensor
ghod|#ehiruh#wkh#phvvdjh#fkdqjhv#eulhľ|#iurp#ĠDoo#
vertical, however,
so that its beam fohduġ#wr#ĠLqwuxghu$ġ1 ohjv#lq#glļhuhqw#xqfrqqhfwhg#urzv/#zh#frqqhfw#
stays horizontal. Li#|rxġuh#kdylqj#wurxeoh#wuljjhulqj#lw/#wu|# d#663#đ#uhvlvwru#ehwzhhq#wkh#qhjdwlyh#+vkruwhu,#
dowhulqj#wkh#vhqvlwlylw|#ri#wkh#vrxqg#vhqvru#e|# ohj#dqg#wkh#jurxqg#udlo#ri#wkh#euhdgerdug1#Wkh#
dgmxvwlqj#wkh#orzhu#srwhqwlrphwhu#vfuhz#+pdunhg# srvlwlyh#+ehqw/#orqjhu,#ohj#lv#frqqhfwhg#wr#JSLR#49#
G#iru#gljlwdo,#rq#lw=#wxuqlqj#lw#dqwlforfnzlvh# rq#Udvsehuu|#Sl/#dv#lq#wkh#Figure 1#zlulqj#gldjudp1
lqfuhdvhv#wkh#vhqvlwlylw|/#exw#grqġw#ryhugr#lw#ru#
wkh#GDW#OHG#zloo#eh#olw#xs#frqvwdqwo|1
Alarm code
09 Zlwk#hyhu|wklqj#zluhg#xs#dv#lq#Figure 1/#
|rxġuh#qrz#uhdg|#wr#surjudp#|rxu#lqwuxghu#dodup1#Lq#
wkh#Ľqdo#frgh/#intruder_alarm.py/#zh#dgg#OHG#dqg#
Ex}}hu#wr#wkh#jslr}hur#lpsruwv#dw#wkh#wrs1#Zh#dovr#
lpsruw#vohhs#iurp#wkh#wlph#oleudu|/#wr#xvh#dv#d#ghod|1
Li#|rx#zdqwhg/#|rx#frxog#fuhdwh#d#vhsdudwh#
ixqfwlrq#zlwk#d#glļhuhqw#phvvdjh#iru#hdfk#dodup#
+olnh#rxu#Ľuh#dqg#jdv#dodup#odvw#lvvxh,/#exw#wklv#wlph#
zhġyh#nhsw#lw#vlpsoh#zlwk#d#vlqjoh#dodup#ixqfwlrq/#
laser_test.py
> Language: Python
intruder_alarm.py
sensor. Its sensitivity
009. else: can be altered by
adjusting the A
010. msg = "All clear" (analogue) or D (digital)
011. print(msg, end = "\r") potentiometer screw
> Language: Python
dv#zhġuh#qrw#erwkhuhg#krz#dq#lqwuxghu#lv#ghwhfwhg1#
001.
002.
from gpiozero import Button, LED, Buzzer
from time import sleep
Top Tip
Zkhq#wuljjhuhg/#wklv#h{hfxwhv#d#for#orrs#zklfk# 003. Analogue out
wrjjohv#wkh#OHG#dqg#ex}}hu#rq#dqg#rļ#d#vhw#qxpehu# 004. laser = Button(21)
ri#wlphv/#zlwk#d#318#vohhs#ghod|#hdfk#wlph1 005. sound = Button(14) For simplicity,
Lq#d#while True:#orrs/#zh#fkhfn#wkh#slq#ydoxhv# 006. led = LED(16) we’ve used the
iurp#erwk#vhqvruv#dqg#wuljjhu#wkh#dodup#zkhq#wkh# 007. buzzer = Buzzer(25) digital output of
the sound sensor
odvhu#ehdp#lv#eurnhq#+laser.value == 0,#ru#wkh# 008.
to trigger our
vrxqg#wkuhvkrog#lv#h{fhhghg#+sound.value == 1,1#Li# 009. def alarm(): alarm. To use the
qhlwkhu#lv#wuljjhuhg/#zh#vkrz#wkh#ghidxow#phvvdjh# 010. print("Intruder alert!", end = "\r") analogue output,
dqg#hqvxuh#wkh#OHG#dqg#ex}}hu#duh#wxuqhg#rļ1 011. for i in range(10): you’ll need to
012. led.toggle() add an ADC chip
013. buzzer.toggle() (e.g. MCP3008) to
convert its signal
014. sleep(0.5)
to a digital reading.
Test the alarm
10 Qrz#wr#whvw#wkh#dodup#v|vwhp1#Dv#ehiruh/#
015.
016. while True:
We’ll cover how to
use an ADC in the
wu|#euhdnlqj#wkh#odvhu#ehdp=#wkh#OHG#vkrxog#wkhq# 017. if laser.value == 0 or next instalment.
eolqn#dqg#wkh#ex}}hu#zloo#ehhs1#Gr#wkh#vdph#iru#wkh# sound.value == 1:
vrxqg#vhqvru#e|#pdnlqj#d#surorqjhg#orxg#qrlvh>#wkh# 018. alarm()
dodup#zloo#wuljjhu#djdlq1#Hdfk#wlph/#wkh#ĠLqwuxghu$ġ# 019. else:
phvvdjh#zloo#vkrz#lq#wkh#Vkhoo#duhd1 020. print("All clear ",
end = "\r") The Waveshare laser
sensor. The lens for
021. led.off() the receiver is on the
022. buzzer.off() left, with the metal
laser tube just to the
Taking it further right of it
Zh#qrz#kdyh#d#vlpsoh#lqwuxghu#dodup1#Wr#lpsuryh#
lw/#|rx#frxog#dgg#h{wud#vhqvruv#vxfk#dv#d#SLU#ru#
hyhq#d#fdphud#wr#ghwhfw#pryhphqw1#\rx#frxog#
wuljjhu#d#odujhu#oljkw#dqg2ru#sod|#dq#dohuw#vrxqg#
ru#vsrnhq#phvvdjh#rq#d#frqqhfwhg#vshdnhu1#\rx#
frxog#dovr#vhqg#dq#hpdlo#ru#sxvk#qrwlĽfdwlrq#dohuw#
wr#|rxu#skrqh#zkhqhyhu#wkh#dodup#lv#wuljjhuhg1
Qh{w#wlph#zhġoo#fuhdwh#d#zhdwkhu#vwdwlrq#xvlqj#
whpshudwxuh/#kxplglw|/#dqg#xowudylrohw#oljkw#
vhqvruv1#Vhh#|rx#wkhq1#
Overclock
Raspberry Pi Zero 2 W
Give Raspberry Pi Zero 2 W a speed boost by setting overclock
settings in the config.txt document
R
Cool your Zero 2 W
dvsehuu|#Sl#]hur#5#Z#kdv#d#srzhuixo#
Fruwh{0D86#txdg0fruh#surfhvvru#uxqqlqj#
01 We’re going to place Raspberry Pi Zero 2 W
dw#d#ghidxow#vshhg#ri#4JK}1#It is possible to inside a FLIRC Raspberry Pi Zero Case (£13/$18,
Lucy
MAKER
give this a boost up to 1.2GHz, or even 1.4GHz. The pdjsl1ff2ľluf}hur). The metal case acts as a
Hattersley extra speed makes Raspberry Pi OS more snappy, heatsink. For a cheaper option, attach a Heatsink
Lucy is editor of The and comes in useful when setting up Zero 2 W for Zero 2 W (£1/$1, pdjsl1ff2}hur5khdwvlqn).
MagPi magazine projects that are a little more demanding and
and eggs her little could use a little push (such as image processing
Raspberry Pi to
or retro gaming). There is a chance, however, that
run at ever faster
Update Raspberry Pi OS
speeds. If only she
could run this fast!
Raspberry Pi Zero 2 W will start to overheat and
throttle back the CPU, keeping it safe but making
02 Make sure you are running the latest version
magpi.cc Raspberry Pi OS slower. of Raspberry Pi OS. Open a Terminal and enter
As with all overclocking projects, it’s important the following:
to consider a cooling solution for Raspberry Pi.
Overclock is fun to experiment with, however. So sudo apt update
let’s give Zero 2 W a bit more zest. sudo apt full-upgrade
# Overclock settings
# over_voltage=6
Top Tip
arm_freq=1200
Monitoring voltage
The over_voltage command adjusts the core CPU/ It is essential to keep the supply voltage above 4.8 V for reliable performance. Note
JSX#yrowdjh/#dqg#dffhswv#Ľjxuhv#ehwzhhq#049#dqg# that the voltage from some USB chargers/power supplies can fall as low as 4.2 V.
;1#Wkh#ghidxow#ydoxh#lv#31#Wkh#odwhvw#Ľupzduh#lq# This is because they are usually designed to charge a 3.7 V LiPo battery, not to
Exoovh|h#zloo#gr#lwv#ehvw#wr#Ľjxuh#rxw#wkh#fruuhfw# supply 5 V to a computer.
voltage for an overclock, so we have left over_ To monitor Raspberry Pi’s PSU voltage, you will need to use a multimeter
to measure between the VCC (5 V) and GND pins on the GPIO. More
voltage commented out for now (more info at
information on power requirements is available on the Raspberry Pi
pdjsl1ff2exoovh|herqxv,1#Vdyh#wkh#Ľoh#zlwk# ƵåÆŸĜƋå×Ƥmagpi.cc/powersupply.
CTRL+O (press RETURN) and use CTRL+X to exit.
Top Tip
Crank it up Overclocking problems
06 Let’s try taking things a little faster. Set the
Most overclocking issues show up immediately with a
ARM CPU to 1.4GHz. We managed to get our Zero
failure to boot. If this occurs, hold down the SHIFT key
2 W to run at this speed, but only by including the during the next boot. This will temporarily disable all
over_voltage setting. Edit the frqĽj1w{w#Ľoh= overclocking, allowing you to boot successfully and then
Warning! edit your settings.
Crash likely! over_voltage=6 Alternatively, remove the microSD card from your
arm_freq=1400 Raspberry Pi and insert it into another computer. You
Experimenting with will be able to access the ÏŅĹĀčţƋƻƋĀĬå±ĹÚ±ÚģƚŸƋƋĘå
# gpu_freq=700
overclocking may settings from there. If all else fails, use Raspberry Pi
crash your Raspberry Imager to install a fresh copy of Raspberry Pi OS to the
Pi. There is a chance of
This is as high as we’re going to take over_voltage. microSD card.
corrupting the microSD
card. Experiment with Reboot the Raspberry Pi and you’ll be running at
a clean Raspberry Pi
OS installation and 1.4GHz. Run watch -n 1 vcgencmd measure_clock
ensure no important arm again to see the new upper limit. You can also
data is at risk.
magpi.cc/overclock
try uncommenting the gpu_freq. The gpu_freq The gpu_freq setting
oversees a range of settings: core_freq, h264_freq,
isp_freq, and v3d_freq. All the Zero 2 Ws we tested
should be removed if a
failed to boot with faster gpu_freq settings.
Raspberry Pi fails to boot
Recover from black screen
07
config.txt We think arm_freq=1200 is a good speed
boost. Our engineering team told us that the
ehqhĽwv#iurp#gpu_freq are marginal at best,
> Language: Bash and the gpu_freq setting should be removed if
a Raspberry Pi fails to boot. Your Raspberry Pi
001. # Overclock settings is likely to fail to boot at some point during
002. over_voltage=6 overclocking. See ‘Overclocking problems’ (above)
003. arm_freq=1400 for more information on recovery. Otherwise,
004. #gpu_freq=700 have fun and enjoy squeezing the most out of your
Raspberry Pi Zero 2 W computer.
Midas first introduced the HDMI TFT range in 2018, and have continued to develop this range over the
past 3 years. These displays are ideal ‘plug & play’ devices for a Raspberry Pi SBC.
With the addition of a Raspberry Pi SBC, the Midas Displays HDMI TFT modules become a fully func-
tional, easy-to-use displays. The integrated PCB has a 40-pin GPIO interface and a standard 19-pin
type-A HDMI connector, enabling direct connection of a Raspberry Pi SBC. The HDMI TFT modules
can also easily be used with many other single board computers. These key features enable the
HDMI TFT displays to be used with any external HDMI input source.
Key Features
• 4.3”, 5.0”, 7.0”, 10.1”, & 5.2” bar-type, sizes
available
• IPS all-round viewing options
• ‘Plug & play’ with Raspberry Pi
• HDMI interface
• Capacitive, resistive, and non, touch options
available
• Up to 1100cd/m ² brightness
Ultimate home
Part 05
server: Backup
and UPS
Now you have the ultimate server, let’s keep your
data safe with an uninterruptable power supply
PJ Evans
MAKER
I
{IĜŸ±ƵųĜƋåųØ f you’ve been following our home server Zhġuh#jrlqj#wr#fryhu#wkh#wkuhh#nh|#slooduv#ri#
ŸŅüƋƵ±ųåÚåƴåĬŅŞåų
tutorials over the past months, you should vhuyhu#pdqdjhphqw=#Edfnxs/#Uholdelolw|/#dqg#
±ĹÚƋĜĹĩåųåųţBå
ĩååŞŸŸåƴåų±ĬÏĬŅĹåŸ now have a pretty sweet Raspberry Pi- Prqlwrulqj1#Oxfnlo|/#wkhvh#duh#qrw#kdug#wr#dfklhyh/#
ŅüĘĜĵŸåĬüĜĹŸƋŅų±čå srzhuhg#vhuyhu#xs#dqg#uxqqlqj/#zlwk#Ľoh# hyhq#iru#d#krph#vhwxs/#dqg#|rx#qhyhu#nqrz=#wkhuh#
ģƚŸƋĜĹϱŸåţ sharing, media streaming, remote access, pd|#frph#d#gd|#zkhq#|rxġuh#uhdoo|#jodg#|rx#wrrn#
twitter.com/ and more.#Lq#wklv#Ľqdo#sduw#ri#rxu#Xowlpdwh# wkh#wlph#wr#surwhfw#|rxu#lqyhvwphqw1
mrpjevans Vhuyhu#wxwruldo/#zhġuh#jrlqj#wr#orrn#dw#surwhfwlqj#
erwk#|rxu#kdug#zrun#dqg#doo#wkdw#gdwd#|rx#kdyh#
hqwuxvwhg#wr#rxu#idyrxulwh#olwwoh#frpsxwhu1#
Don’t be that person
RAID systems,
01 Zkhq#|rxġyh#frpsohwhg#d#surmhfw#olnh#wklv/#
like this RAID 10
lwġv#whpswlqj#wr#vwrs#qrz#dqg#hqmr|#wkh#iuxlwv#ri#
ÏŅĹĀčƚų±ƋĜŅĹØ
ŞųŅƋåÏƋ±č±ĜĹŸƋÚĜŸĩ |rxu#oderxu1#Vdgo|/#wkh#dqqdov#ri#frpsxwhu#klvwru|#
ü±ĜĬƚųå±ĹÚŸåųƴĜÏå
ĜĹƋåųųƚŞƋĜŅĹÆƼ duh#Ľoohg#zlwk#vwrulhv#ri#wkrvh#zkr#glg#qrw#khhg#wkh#
ÚƚŞĬĜϱƋĜĹčÚ±Ƌ±Ņƴåų zduqlqjv#dqg#glgqġw#edfn#xs1#Lwġv#fdxvhg#khduweuhdn#
ĵƚĬƋĜŞĬåÚĜŸĩŸ
zkhq#idplolhv#kdyh#orvw#wkhlu#skrwr#oleudulhv#
dqg#edqnuxswf|#zkhq#frpsdqlhv#kdyh#orvw#wkhlu#
suhflrxv#fxvwrphu#gdwd1#Qhyhu#wuxvw#|rxu#gdwd#wr#rqh#
vlqjoh#vrxufh/#qr#pdwwhu#krz#pxfk#|rxġyh#vshqw/#ru#
wkh#uhsxwdwlrq#ri#wkh#vxssolhu1#Wklqn#fduhixoo|#derxw#
krz#wr#nhhs#|rxu#gdwd#vdih/#qrw#rqo|#iurp#kdugzduh#
ru#vriwzduh#idloxuh/#exw#dovr#wkhiw#dqg#glvdvwhu1
Ęåųå±ųåĵ±ĹƼ
Let’s go offsite
ƚĹĜĹƋåųųƚŞƋĜÆĬåŞŅƵåų
ŸƚŞŞĬƼŠ{šĵŅÚåĬŸ 05 D#fhqwudo#sulqflsoh#ri#d#jrrg#edfnxs#srolf|#
±ƴ±ĜĬ±ÆĬåƋʱƋŞųŅƴĜÚå
±Ÿĵ±ĬĬüŅŅƋŞųĜĹƋ±ĹÚ lv#wkdw#dw#ohdvw#rqh#frs|#lv#qrzkhuh#qhdu#|rx1#Wklv#
±Úåŧƚ±ƋåƋĜĵåüŅų
lv#wr#surwhfw#djdlqvw#doo#wkrvh#wklqjv#zh#uhdoo|#grqġw#
±ÏĬå±ĹŸĘƚƋÚŅƵĹØ
ŞåųüåÏƋüŅųĘŅĵåƚŸå zdqw#wr#wklqn#derxw#vxfk#dv#Ľuh/#ľrrg/#wkhiw/#ru#
rwkhu#w|shv#ri#gdpdjh1#D#zlgh#udqjh#ri#vhuylfhv#
h{lvw#wr#vhfxuho|#vwruh#|rxu#gdwd#iru#|rx#iru#d#
uhdvrqdeoh#ihh1#Li#wkh#zruvw#kdsshqv/#d#frs|#ri#doo#
|rxu#suhflrxv#gdwd#zloo#eh#dydlodeoh#wr#uhwulhyh1#
Vrph#hyhq#rļhu#d#kdug0gulyh0e|0srvw#vhuylfh1#
Wkhuh#duh#wrr#pdq|#vhuylfhv#wr#fryhu#khuh/#exw#
vrph#wulhg#dqg#whvwhg#vroxwlrqv#iru#Udvsehuu|#Sl#RV#
Top Tip lqfoxgh#lGulyh/#Dpd}rq#V6/#dqg#EdfnEod}h#E51
Time Machine
Introducing iDrive
Not only can you
back up your 06 Li#|rx#zdqw#wr#nhhs#wklqjv#hdv|/#zh#fdq#
ultimate server, but
uhfrpphqg#lGulyh#+idrive.com,#dv#d#frqwhqghu1#Qrw#
it can back up your
rqo|#gr#wkh|#rļhu#yhu|#dwwudfwlyh#Ľuvw0|hdu#whupv=#
Mac as well. Make
ƼŅƚųĀĬåŸĘ±ųåŸ wkh|#duh#rqh#ri#wkh#ihz#rļ0vlwh#edfnxs#frpsdqlhv#
Ĝĵåa±ÏĘĜĹåě wr#rļhu#ixoo#Olqx{#+l1h1#Udvsehuu|#Sl#RV,#vxssruw1#
compatible by Dowkrxjk#|rxġoo#qhhg#wr#gr#vrph#qdyljdwlrq#ri#
üŅĬĬŅƵĜĹčƋĘåŸå Uv|qf#zloo#rqo|#frs|#fkdqjhv/#vr#lwġv#idvwhu#diwhu# wkh#frppdqg#olqh/#|rx#fdq#lqvwdoo#wkh#lGulyh#wrrov#
instructions:
wkh#lqlwldo#edfnxs1#Wr#uxq#wklv#rq#d#uhjxodu#edvlv/# dqg#fuhdwh#d#ghvwlqdwlrq#dqg#d#edfnxs0vhw#lq#d#
magpi.cc/
dgg#lw#wr#furqwde#+d#vfkhgxoh#ri#uhjxodu#mrev,= vxusulvlqjo|#vkruw#dprxqw#ri#wlph1#Li#|rx#kdyh#d#
timemachinegit
orw#ri#gdwd/#wkh#Ľuvw#edfnxs#pd|#wdnh#vrph#wlph/#
sudo nano /etc/crontab exw#lGulyh#fdq#wkurwwoh#wkh#edqgzlgwk#xvhg1#Rqfh#
xsordghg/#d#uhjxodu#lqfuhphqwdo#edfnxs#nhhsv#|rx#
Dgg#wklv#olqh#dw#wkh#hqg= xs#wr#gdwh1#Ehvw#ri#doo/#ghohwhg#Ľohv#dqg#glļhuhqw#
yhuvlrqv#ri#Ľohv#fdq#eh#dufklyhg1
1 12 * * * root rsync -av /mnt/huge /mnt/
backup > /var/log/backup.txt 2>&1
BŅĵåeŸŸĜŸƋ±ĹƋ
The amazing rclone
ϱĹĵŅĹĜƋŅųƼŅƚų
Ÿåųƴåų±ĹÚƼŅƚų{Ø
Wklv#zloo#uxq#wkh#edfnxs#hyhu|#qljkw#dw#rqh#plqxwh#
sdvw#wzhoyh1#\rx#fdq#fkdqjh#lw#wr#dq|#wlph#ru#wr#eh#
07 Wkhuh#duh#pdq|#vhuylfhv#dydlodeoh#wkdw#
ƋųĜččåųĜĹč±ĬåųƋŸ
ƵĘåĹĹåÏ域±ųƼ dv#+lq,iuhtxhqw#dv#|rx#olnh1 rļhu#vrph#irup#ri#Ġeorfnġ#ru#Ġexfnhwġ#vwrudjh1#
Prvw#srsxodu#lv#Dpd}rq#V6/#exw#wkhuh#duh#d#
jurzlqj#qxpehu#ri#frqwhqghuv#vxfk#dv#EdfnEod}h#
E5/#Er{/#ru#Gljlwdo#Rfhdq#Vsdfhv1#Zrunlqj#rxw#
krz#wr#frppxqlfdwh#zlwk#doo#wkhvh#fdq#eh#d#
fkdoohqjh/#exw#oxfnlo|#uForqh#+rclone.org,#nqrzv#
krz#wr#wdon#wr#ryhu#73#glļhuhqw#vhuylfhv1#Vljq#xs#
iru#wkh#vhuylfh#|rx#zdqw/#jhw#|rxu#fuhghqwldov/#
dqg#frqĽjxuh#uForqh#xvlqj#lwv#phqxv1#Dowkrxjk#
wulfnlhu#wr#frqĽjxuh#wkdq#lGulyh/#wklv#fdq#eh#d#
yhu|#fkhds#zd|#ri#edfnlqj#xs#lq#wkh#orqj#whup1
ydoxdeoh#|rx#shufhlyh#|rxu#gdwd#wr#eh1#W|slfdoo|/#
skrwrjudskv#idoo#lqwr#wklv#fdwhjru|=#phprulhv#
wkdw#duh#luuhsodfhdeoh1#Wklv#lv#zkhuh#wkh#Ġwzr#
w|shv#ri#phgldġ#uxoh#fdq#frph#lqwr#sod|1#Li#|rx#
devroxwho|#qhhg#wkdw#h{wud#shdfh#ri#plqg/#frqvlghu#
hlwkhu#exuqlqj#wkh#gdwd#wr#jrrg0txdolw|#GYG#ru#
Eox0ud|#URPv#ru/#dv#pdq|#skrwrjudskhuv#gr/#
qhyhu#uhxvlqj#dq#VG#fdug#dqg#dufklylqj#wkhp#
dv#|rx#jr1#Pdq|#edqnv#rļhu#d#fkhds#vdihw|0er{#
vhuylfh#zkhuh#|rx#fdq#vwruh#sk|vlfdo#phgld1
Top Tip
Redundancy is a good thing Let it grow Remote
10 Dqrwkhu#dvshfw#ri#jrrg#vhuyhu#pdqdjhphqw#
12 Qrwklqj#zh#kdyh#glvfxvvhg#khuh#suhyhqwv# Monitoring
lv#dydlodelolw|1#Li#|rx#kdyh#doo#|rxu#frro#gdwd#rq#wkh# |rxu#vhuyhu#iurp#jurzlqj#lq#wkh#ixwxuh1#Prghuq#
If you want to
vhuyhu/#|rx#zdqw#wr#pdnh#vxuh#lw#fdq#kdqgoh#idloxuh# UDLG#v|vwhpv#vxfk#dv#]5#doorz#|rx#wr#lqfuhdvh#
monitor your
dqg#nhhs#jrlqj1#Dowkrxjk#wkh#wzr0gulyh#v|vwhp# glvn#fdsdflw|#zlwk#qr#grzqwlph1#Xvlqj#ordg0 server from afar
zloo#suhyhqw#gdwd#orvv/#lwġv#jrlqj#wr#eh#d#sdlq#wr# edodqflqj#vriwzduh#vxfk#dv#Yduqlvk#phdqv# ±ĹÚʱƴååƻŞŅŸåÚ
uhfrqĽjxuh#hyhu|wklqj1#Iru#d#wuxo|#urexvw#v|vwhp/# |rx#fdq#dgg#lq#pruh#vhuyhuv/#ru#uhsodfh#idlohg# a web server
|rx#qhhg#d#uhgxqgdqw#duud|#ri#lqh{shqvlyh#glvnv# kdugzduh/#zlwkrxw#dq|rqh#qrwlflqj1#\rxġuh#iuhh# ƋŅƋĘåĜĹƋåųĹåƋØ
+UDLG,1#Wklv#lv#d#Ľoh#v|vwhp#wkdw#doorzv#d#qxpehu# wr#dgg#pruh#vriwzduh#dqg#ihdwxuhv#zkhqhyhu#|rx# ŸåųƴĜÏ域ƚÏʱŸ
uptimerobot.com
ri#glvnv#wr#rshudwh#dv#rqh#dqg#fdq#wrohudwh#dw# zdqw1#Dv#iru#rļ0vlwh#gdwd#vwrudjh/#wkhuh#uhdoo|#
will alert you if
ohdvw#rqh#gulyh#idloxuh1#\rx#fdq#wkhq#uhsodfh#wkh# duh#qr#sudfwlfdo#olplwv1#Dq|#wlph#|rx#qhhg#wr#
ƋĘåƼϱĹ
gulyh#dqg#kdyh#wkh#gdwd#surwhfwhg#djdlq#zlwk#qr# errvw#|rxu#kdugzduh/#lwġv#srvvleoh#wr#gr#lw#zlwk#qr# ĹŅĬŅĹčåųųå±ÏĘ
grzqwlph#dw#doo1#Wkh#]IV#Ľoh#v|vwhp#lv#hvshfldoo|# lqwhuuxswlrq/#djdlq#dqg#djdlq/#wuxo|#pdnlqj#lw#wkh# your site.
jrrg#dw#wklv1 xowlpdwh#vhuyhu1#
R
to the pad, the longer this will take (though it should
aspberry Pi Pico doesn’t have only be a tiny fraction of a second). If it’s above a
capacitive touch hardware on board. certain threshold, then we consider the pad touched.
However, that doesn’t mean we can’t If not, then we don’t.
use capacitive touch. To understand The good news is that CircuitPython can do all of
how, we first need to learn a little about this for us. All we need to do is attach the external
how capacitive touch works. 1 M1 resistor between a pad and ground.
Ben Everard All electrical conductors have some amount of We can then read the state of the touch sensor with:
capacitance – basically, this is an ability to store
import time
@ben_everard electrical charge. If you put one end of a wire into
import board
a circuit without the other end attached, you might
import touchio
Ben's house is slowly think that no electricity flows, but actually, a little
being taken over by 3D
printers. He plans to
does. It charges the wire and this small charge will
touch_pad = board.GP9
solve this by printing an remain stored in the wire until it’s discharged. How
extension, once he gets much charge it stores depends on the size of the
enough printers. touch = touchio.TouchIn(touch_pad)
wire, what it’s made from, etc.
Capacitive touch sensing works because your body
while True:
is a conductor. If you connect a wire to a circuit that
if touch.value:
you’re holding the end of, it’ll be able to store slightly
print("Touched!")
time.sleep(0.05)
MAKING A GAME
Let’s make a simple reaction game. In this, we’ll light
up an LED, then the aim is to touch the touchpad as
soon as possible after the LED lights up.
This is done with the following code:
import time
import board
import touchio
import digitalio
import random
THRESHOLDS
We mentioned at the start that this is just reading the Above
touch_pad = board.GP9 The touch inputs on
capacitance of the pad and whatever it’s connected this games controller
led_pin = board.GP25 are a bit messy, but
to. However, how does CircuitPython know if a
led = digitalio.DigitalInOut(led_pin) they work well
capacitance is enough to be a touch? After all, if
led.direction = digitalio.Direction.OUTPUT
you’re attaching different hardware to Pico, you might
get different capacitances.
touch = touchio.TouchIn(touch_pad)
It’s done with a simple thresholding. You can see
led.value = False
the actual value returned by the touch sensing with:
M a k
n
e
gif ts with
your
s p
ow
b e r r y Pi
Ra
r so n al
mate pe
e u l ti es
Build th r your loved on
gift fo
O
ne of the goals of the magazine is to
inspire people to build things using
Raspberry Pi. There’s so much you can
do with the various Raspberry Pi computers and
Raspberry Pi Pico, and we hope that just one idea
lights a spark.
Lots of people get a new Raspberry Pi for
Christmas, but what if they got some inspiration
too? Building something unique and amazing
might just be the way to get someone interested,
and it makes for an incredibly personal gift as well
– especially if they can start using it day-to-day.
So, grab some wrapping paper in one hand and
awkwardly balance a 3D printer in the other, and
let’s get festive.
a dio
G row K it
rb pac k Pir a te R
with he
radio
c/ p irate
pi.c ro
URL:
mag
$ 5 4 rry Pi Ze
rbs / e
rowkithe : £4 8 aspb
pi.cc/g
PRICE ing R
URL: mag art-l
o o k
0 / $4 5 plant A sm kit
PRICE: £4 style with this et radio
in n
me basil inter
Grow so em
ing syst
monitor
Picad
URL: e Rock
yBor
mag
PRIC pi.cc
E: £1 /pic
6 ade URL
g
Buil 5/$ :m
d-it- 225 PRIC agpi.cc
your E: £9 /roc
self
mini Thr 9/ kyb
arca ee- $ 135 org
de bud w hee
get led
, bu f
t ex un with
cell this
ent
, rob
ot k
it
64 magpi.cc
FEATURE
DMG
Pi Boy pi.cc / p iboy
dmg
mag 0 eld
URL: 6 / $13 te handh
E: £ 9 a
PRIC h e ultim ne
te t achi
Crea ing m
gam
retro
Monst
PRICE
e
URL: m
agpi.c
: £210
c/mo rBorg
nsterb
Serio / $286 org
us ro
botic
s for
seriou
s raci
ng
irr or
o n K it a gic m
AIY Vi si ” m
URL: magp
i.cc/aiyvis
/ $93
ion
13.3 m a g pi.cc
/ma
g ic mirrork
it
uick
er
PRICE: £83 h a came
ra for URL: 2 08 r or q
w it 5/$ mir
Machine
lea rning
RI CE : £18 n s mart
P ur ow
cognition e yo
image re Mak
Media centre you can still make an excellent retro gaming machine
with a Raspberry Pi 3 or newer.
URL: magpi.cc/102 You can also preload it with new games that are
MAKER: Rob Zwetsloot ĵ±ÚåƋŅÆåųƚűŸkaŸŅĹåĵƚĬ±ƋŅųŸôĀĹÚŅƚƋ
COST: £10 / $10 minimum, and a spare Raspberry Pi about them on magpi.cc/legalroms.
66 magpi.cc
FEATURE
Handheld console
and a bit of maker experience. Basically, you spin the
globe and then move the reticule up and down, and
the nearest radio station to wherever in the world
URL: magpi.cc/55 the reticule is over will be played. Jude, the creator,
MAKER: Ruiz Brothers mentions how he’s discovered loads of great music
COST: £50 / $60, plus 3D-printed materials using this. It uses web radio to play the feeds, and
the physical build itself is made up of a variety of
It doesn’t seem that long ago that we made this components to make the whole thing work. You can
Raspberry Pi Zero-powered handheld in the magazine ŞųŅƱÆĬƼÚŅĜƋÏĘå±ŞåųÆƼŸåĬåÏƋĜĹčÚĜýåųåĹƋޱųƋŸØŅų
– the whole thing still works great, though. It’s based ųåÏƼÏĬĜĹčŸŅĵåŸƋƚýüųŅĵƼŅƚųŅƵĹĘŅĵåţ
on a build from Adafruit called PiGRRL 2.0 which used
a full-size Raspberry Pi, and you could swap it out for
a newer Raspberry Pi if you wish – although you may
ĹååÚƋŅåÚĜƋƋĘåXĀĬåŸüŅųƋĘåϱŸåĜüƼŅƚƚŸå±
Raspberry Pi 4.
Şå±ĩĜĹčŅüƐ%ŞųĜĹƋĜĹčƋĘåĀĬåŸØƵåųåÏŅĵĵåĹÚ
using a softer material for the buttons and D-pad. Your
recipient’s thumbs will thank you in the long run.
68 magpi.cc
FEATURE
Weather station
URL: magpi.cc/weatherstation
MAKER: The Raspberry Pi Foundation
COST: Varies
Digital camera
You can do something like this in two ways. You can
either make a screen like a digital photo frame (see
previous page) that displays weather data from the
URL: magpi.cc/beccacam internet. Or, you can build a full-on weather station to
MAKER: Becca Farsace know exactly what the weather is like right now.
COST: £110 / $150 plus an old camera shell This project is a little bit on the large side, and will
need the recipient to mount parts of it outside, so make
We featured this in the magazine last year, where ŸƚųåƋĘåƼϱĹÚŅŸŅĵåƋĘĜĹčĬĜĩåƋĘĜŸĀųŸƋúĘåŅųĜčĜűĬĩĜƋ
Becca used a classic camera shell to create her for the Oracle weather station is sold out now, but you
own, very nice, digital camera using a Raspberry Pi can source parts using the Foundation’s guide.
and a HQ Camera. It also has an LCD screen so you
can get nice previews. It would also work well with
a new Raspberry Pi Zero 2 W if you’d like to save
space elsewhere.
Old and broken cameras can be found on eBay
pretty cheaply, but otherwise you could 3D-print your
own case for this build.
Magic Mirror
URL: magicmirror.builders
MAKER: Michael Teeuw
COST: £100-£200 / $150-$300
Preload it with
PKEGǭRJTCUGUǭHQTVJG
intended recipient
70 magpi.cc
FEATURE
DIMENSIONS
AND
Turn Raspberry Pi into a professional touchscreen
ENVIRONMENT: display system. By Lucy Hattersley
Module size:
120.70 × 75.80
D
× 23.20 mm;
Operating isplays like this Midas 5in TFT LCD are The Midas 5in TFT LCD has the same resolution
temperature: used in a variety of industrial settings. dv#wkh#RĿfldo#Udvsehuu|#Sl#:lq#Wrxfkvfuhhq#
-20°C ~ +70°C; Don’t be surprised if you’ve already used Display (pdjsl1ff2rĿfldoglvsod|). However, this
Logic voltage: 5V
one of these in a vending machine, EV charger, or device uses an HDMI connection for the display,
DISPLAY: information display. and a micro-USB to USB-A cable to provide
Display size: 5.0 Midas sent us a 5in IPS display for touchscreen feedback.
inch; Resolution: testing (part number: MDT0500D2IHC-HDMI, Our test unit came with a U-shaped MCIB-HDMI
800×480;
magpi.cc/midas5in). It is a small screen with a adapter that neatly connected Raspberry Pi 3B+
Orientation:
Landscape; quirky 800×480 resolution and 5:3 aspect ratio. It to the display. We tested it with a Raspberry Pi 4
Brightness: also comes with a ten-point capacitive touchscreen using a Mini-HDMI to HDMI cable and it worked
750 cd/m2 and GPIO integration. mxvw#Ľqh1
The screen is connected to the Raspberry Pi
INPUT/OUTPUT:
Touchscreen: via the GPIO pins. A look at the datasheet Setting up
CTP; Interface: (magpi.cc/midas5indatasheet) shows that GPIO 17 Our test unit came with a Raspberry Pi 3B+
HDMI; Pinout: is used to control the backlight, and power is passed and microSD card, along with some printed
40-pin GPIO through the GPIO pins (it is powered via a standard instructions. It was easy to disassemble and,
5 V supply connected to Raspberry Pi). A GPIO consequently, reassemble. Just attach it to the
breakout on the rear of the device enables you to GPIO pins, insert the HDMI and USB cables, and
attach further electronic components or HATs. away you go.
config.txt
Here we are using
MagicMirror2 to
build a custom
information board
Raspberry Pi
connects to the
MDT0500D2IHC
board via GPIO pins,
a HDMI connection,
and USB
8
though.
weather information board; we then used Info- background. But if you want a small screen to
Beamer (magpi.cc/infobeamer) to turn it into integrate into a build, or want to experiment with a
/10
a photo display board and play video clips. In small magic mirror or information screen; this is a
addition, we added an on-screen keyboard to great choice.
PicoSystem
Pimoroni magpi.cc/picosystem £59 / $66
SPECS
INTERNALS:
RP2020 chip A handheld console built around RP2040 and with
(dual Arm
Cortex-M0+ game development in mind. Rob Zwetsloot boots it up.
running at up
E
to 133MHz
with 264kB of xtremely tiny handheld consoles have not Udvsehuu|#Sl#Slfr#ru#rwkhu#US53730edvhg#v|vwhpv/#
SRAM), 16MB always had the best track record in the doorzlqj#|rx#wr#hdvlo|#wudqvihu#vnloov#ryhu#iurp#
of QSPI flash
microcomputer space. A few Raspberry Pi hovhzkhuh1#FlufxlwS|wkrq/#zklfk#lv#edvhg#rq#
supporting XiP
]hur#hļruwv#hqghg#xs#ehlqj#mxvw#d#olwwoh#wrr#vpdoo# PlfurS|wkrq#lv#vxssruwhg#dv#zhoo/#dqg#wkhuhġv#hyhq#
DISPLAY: dqg#Ľqqlfn|#iru#dfwxdo#xvh/#dqg#lw#glgqġw#txlwh#khos# d#65eolw#VGN/#doorzlqj#|rx#wr#sruw#ryhu#jdphv#iurp#
ŎţĂĉtÏŅĬŅƚų wkdw#wkh|#riwhq#xvhg#kdug#6G0sulqwhg#exwwrqv#wkdw# Slprurqlġv#65eolw#kdqgkhog#frqvroh1
SPI IPS LCD
zhuh#xqfrpiruwdeoh1#Zhġuh#sohdvhg#wr#vd|#wkdw# Wkh#vwdqgdug#F..#dqg#PlfurS|wkrq#DSL#dggv#
(240×240 pixels)
Slprurqlġv#SlfrV|vwhp/#zkloh#vwloo#vpdoo/#pdqdjhv# ordgv#ri#ixqfwlrqv#wr#pdnh#fuhdwlqj#jdphv#voljkwo|#
FEATURES: wr#dyrlg#wklv1 hdvlhu/#lqfoxglqj#fdphud#frqwuro/#olqnlqj#wr#exwwrqv/#
D-pad and Lwġv#pdgh#iurp#ploohg#doxplqlxp/#kdv#surshu# dqg#sulplwlyhv#iru#gudzlqj#vsulwhv#pruh#hdvlo|#wkdq#
buttons,
exwwrqv/#dqg#d#qlfh#olwwoh#vtxduh#vfuhhq#zlwk# exloglqj#wkhp#sl{ho#e|#sl{ho1#Wkhuh#duh#glļhuhqw#lq0
525 mAh
LiPo battery, 573¹573#sl{hov1#Lw#ihhov#qlfh#wr#krog#Ğ#wkhuhġv#d# hqjlqh#hļhfwv#|rx#fdq#dsso|#wr#wh{w#dqg#vxfk#Ğ#lwġv#
piezo buzzer/ elw#ri#khiw#Ğ#dqg#kroglqj#lw#lv#qrw#xqfrpiruwdeoh1# d#phdw|#DSL#wkdw#|rx#fdq#jhw#d#orw#rxw#ri#iru#mxvw#d#
speaker, Lw#frphv#zlwk#d#jdph#suh0lqvwdoohg=#Vxshu#Vtxduh# vlpsoh#sl{ho#jdph#rq#d#olplwhg#slhfh#ri#kdugzduh1
CNC-milled
Eurv/#d#sodwiruphu1#Krzhyhu/#wkh#pdlq#gudz#uhdoo|# Wkh#fxuuhqw#jdphv#dydlodeoh#iru#SlfrV|vwhp#
aluminium
case, wrist lv#wkdw#|rx#fdq#pdnh#jdphv#iru#lw#|rxuvhoi1 uxq#devroxwho|#Ľqh#dv#zhoo/#dowkrxjk#wkh#odfn#ri#
strap d#surshu#vshdnhu#lv#d#olwwoh#qrwlfhdeoh1#Wkh#slh}r#
Make your own fun ex}}hu#vrxqgv#duh#txlwh#fkduplqj#lq#wkhlu#rzq#
SlfrV|vwhp#xvhv#lwv#rzq#rĿfldo#DSL/#zklfk# zd|/#wkrxjk/#dqg#vpduw#xvh#ri#lw#fdq#fuhdwh#vrph#
zrunv#PlfurS|wkrq#dqg#F..#0#mxvw#olnh#d#vwdqgdug# qlfh#uhwur#eohhsv#dqg#eorrsv1
74 magpi.cc PicoSystem
REVIEW
Pocket games
Vzlwfklqj#rxw#jdphv#lv#d#olwwoh#pruh#wulfn|#wkdq#
fkdqjlqj#fduwulgjhv/#wkrxjk#Ğ#wkhuhġv#olplwhg#
vsdfh#rq#wkh#SlfrV|vwhp/#dqg#|rx#qhhg#wr#frqqhfw# Verdict
lw#wr#d#frpsxwhu#wr#gr#d#txlfn#uh0ľdvklqj#wr#sod|#
An incredibly cool,
d#glļhuhqw#jdph1#Lwġv#qrw#wrr#iuxvwudwlqj/##dv#lwġv#
tiny handheld
suhww|#txlfn/#vr#iru#ghyhorsphqw#|rx#grqġw#kdyh# that you can fairly
wr#zdlw#wrr#orqj1#Li#|rxġuh#rxw#dqg#derxw#zlwk#lw# easily develop
kdqjlqj#iurp#|rxu#zulvw/#wkrxjk#+lw#frphv#zlwk#d# games for. We
frro#odq|dug,/#|rx#zloo#eh#idluo|#olplwhg1 ģƚŸƋƤƵĜŸĘĜƋʱÚ
\hw#wkdw#kdvqġw#uhdoo|#vwrsshg#xv1#Lwġv#oryho|#wr# more storage.
9
wdnh#durxqg#zlwk#|rx/#wkh#edwwhu|#odvwv#iru#djhv#dqg#
fkdujhv#suhww|#txlfno|/#dqg#|rx#fdq#pdnh#vrph#
/10
uhdoo|#ehdxwlixo#vwxļ#iru#lw1#Zh#orrn#iruzdug#wr#vhh#
zkdw#nlqg#ri#jdphv#shrsoh#pdnh#iru#lw1#
PicoSystem magpi.cc 75
REVIEW
FEATURES:
LiPo battery
Essential battery backup power for your Raspberry Pi Zero. By Phil King
W
recharge
chip, voltage hen you have a Raspberry Pi Zero Note that the UPS HAT will also work with any
boost chip, running constantly for an important Raspberry Pi Zero with a soldered header – so
multiple battery
task, such as to log data from a sensor, long as your soldering isn’t too messy and has
protection
circuits, I2C bus there’s nothing more frustrating than a mains regular peaks to make good connections.
communication power cut. To avoid this, a UPS (uninterruptible
for monitoring power supply) is an essential bit of kit. Battery power
This Waveshare UPS HAT is an interesting Rqfh#Ľwwhg#wr#d#Udvsehuu|#Sl#]hur#zlwk#L5F#
BATTERY:
803040 LiPo option, supplied with a 3.7 V 1000 mAh LiPo enabled, you can power the HAT via its micro USB
battery, battery. Fitting onto a sticky strip on the board, vrfnhw/#wkhq#ľlfn#lwv#rq0erdug#vzlwfk#wr#srzhu#
1000 mAh, 3.7 V the battery has a short cable that plugs into the xs#Udvsehuu|#Sl#Ğ#ru#mxvw#ohdyh#lw#rļ#wr#fkdujh#xs#
board’s mini JST socket. the battery for a while.
CONNECTIVITY:
6 × pogo pins Li#wkh#pdlqv#srzhu#jrhv#rļ/#lwġoo#lqvwdqwo|#
connect to
underside of
You can monitor the switch to battery power. A fully charged battery
should provide power for up to seven hours,
GPIO header
battery level by installing a depending on the Raspberry Pi Zero’s workload.
Naturally, the addition of any connected devices
simple Python program will reduce that time.
You can monitor the battery level by installing
With the battery installed, the board connects d#vlpsoh#S|wkrq#surjudp1#Wklv#vkrzv#wkh#uhdo0
to a Raspberry Pi WH in a novel way: six springy time load voltage, current (negative if battery
pogo pins connect to the solder on the underside power is being used), power, and percentage.
of the GPIO header for power, ground, and While we’ve seen more sophisticated power
I2C pins. This leaves the GPIO header free for management features, such as on the PiJuice, it’s
connecting other HATs on top. a handy tool.
8 /10
DiP-Pi PICO
Dual In-Line Package Raspberry Pi Pico
Rapid Stackable Raspberry Pi Pico
Add-on Boards
Universal and dedicated metallic cases
for professional as also amateur applications
Plenty of ready-to-use examples written
in MicroPython and C
Just take it, load your software
and the application is ready
Open hardware (schematics)
No need to do any soldering
Extremely easy to use
Ultra-low cost No Cables No Solder No Lost Time
DiP-Pi PICO
Key Feature PIoT Power Master Wi-Fi Master
6-18V Power Input (EPR) Yes Yes -
Battery Power/Charging Yes Yes -
UPS Functionality Yes Yes -
On Board ON/OFF Switch Yes Yes Yes
On Board RESET Switch Yes Yes Yes
On Board ESP8266 Wi-Fi Yes - Yes
MicroSD Slot Yes - Yes
On Board 1-wire Interface Yes Yes Yes
On Board DHT22/21 Interface Yes Yes Yes
Plenty of Informative LEDs Yes Yes Yes
DISTRIBUTORS:
REVIEW
3.7” e-Paper
e-Ink Display for
Raspberry Pi Pico
The Pi Hut magpi.cc/epaperpico From £24 / $28
SPECS
E
greyscale
-ink displays have long proven useful for
REFRESH: portable Raspberry Pi applications with
3 seconds (full),
low power requirements where the display
0.3 seconds
(partial) doesn’t require rapid updates. Combined with
the lower-power usage and tiny footprint of
DIMENSIONS: Raspberry Pi Pico, an e-ink display makes an ideal
As with all e-ink displays, anything on screen will
95.3×56.9 mm remain there, even with no power
board, combination for projects like a name badge or
47.32×81.12 mm
display area
weather display.
This 3.7-inch Waveshare e-ink display features
It does offer four levels
two female headers on the rear so that you can of greyscale for fairly
simply plug in a Pico (equipped with soldered
male headers). The graphic on the board makes it accurate shading
clear which way round to orientate Pico to avoid
getting the wrong connections. lv#olplwhg#dqg#sulqwv#vrph#wh{w#dqg#d#frxsoh#ri#
The board also features an eight-pin SPI rectangles in portrait mode. The C code – detailed
interface, so can be wired up to a Raspberry Pi in the wiki – uses landscape mode and is more
computer, Arduino, or another microcontroller. h{whqvlyh/#sulqwlqj#wh{w/#gudzlqj#vkdshv/#dqg#
showing a digital clock with seconds counting.
Four shades of grey Wkhuhġv#qr#h{dpsoh#ri#glvsod|lqj#d#elwpds#
While the 480×280 display is monochrome, it does image, however, so you’ll need to perform a bit of
rļhu#irxu#ohyhov#ri#juh|vfdoh#iru#idluo|#dffxudwh# internet trawling to work out how to do it.
Verdict shading. One advantage of the greyscale display
is that it takes less time to do a full refresh than
The rear features female headers to insert a Pico,
plus an SPI interface to connect other boards
The display itself on colour e-ink equivalents (which Waveshare
works well, and also makes): just three seconds. Even better, it’s
is fast to refresh, possible to do a partial refresh of an area of the
but you’ll need to
screen, for instance for updating a digital clock
do some work on
the code to make
display, in a mere 0.3 seconds.
To make the e-ink display work,
7
the most of it.
you’ll need to visit the Waveshare wiki
(magpi.cc/epaperpicowiki), and download a
/10
}ls#Ľoh#frqwdlqlqj#F#dqg#S|wkrq#h{dpsoh#frgh#
dqg#XI5#Ľohv#wr#ľdvk#wr#Slfr1#Wkh#S|wkrq#ghpr#
PC HARDWARE
ENTHUSIASTS
10 Amazing:
Raspberry Pi The Internet of LEGO
L
ast month we reported on the Raspberry Pi
Build HAT, a new add-on that allows you to
connect Raspberry Pi to LEGO systems for more
precise control. People have been interfacing LEGO
with Raspberry Pi for years, though, and here are some
of the best so far...
QEKTMGGPIKSFSSWX
BrickPi
Bookreader 2
aƚŸĜÏĀč Robotic literature
kĹåŅüƋĘåŅųĜčĜűĬ±ŸŞÆåųųƼ{Ĝ
Toys-to-live X):k±Ú±ŞƋåųŸØƋĘåüŅĬĩŸ±Ƌ%åƻƋåų
ŅĵÆĜĹå8F%Ƌ±čŸØX):kaĜĹĜĀčŸØ±ĹÚ±X):k%ĜĵåĹŸĜŅĹŸƕ FĹÚƚŸƋųĜåŸĵ±Úå±ĬĜƋƋĬåaĜĹÚŸƋŅųĵŸ
ųå±ÚåųرĹÚƼŅƚϱĹųåÏųå±ƋåƼŅƚųü±ƴŅƚųĜƋåƱĹÚŸƵĘŅƵĜĬĬ ųŅÆŅƋƋʱƋŸÏ±ĹĹåÚÆŅŅĩޱčåŸ
ůŞåųüŅųĵűüŅųƼŅƚŅĹƋĘåŸƋ±čåţ ±ƚƋŅĵ±ƋĜϱĬĬƼţĵ±ųƋú
QYWMGƤKGSQ QEKTMGGFSSOVIEHIV
QEKTMGGVSFSXJEGI
X):k±ŸŞÆåųųƼ
{ĜX±ŞƋŅŞ
Retro cool
±ÏĩĜĹƖLjŎƐØƋĘåųåƵ±ŸĹűƋųå±ĬĬƼ±ĹƼ
ĩĜĹÚŅü±ŸŞÆåųųƼ{ĜĬ±ŞƋŅŞŅų±ĬĬěĜĹě
ŅĹ屟ŞÆåųųƼ{ĜÏŅĵŞƚƋåųŸƼŸƋåĵØ
ŸŅ{åƋåųBŅƵĩĜĹŸÆƚĜĬƋĘĜŸŅƵĹŅƚƋ
X):k±ŸŞÆåųųƼ ŅüX):kţ
Robot car
Block chassis
ĘĜŸƴåųƼ%F¥ÆƚĜĬÚĜŸ±čųå±ƋŸĘŅƵϱŸåŅüX):kô±ƴåųƼĵŅÚƚĬ±ųϱųƋʱƋƼŅƚ
ϱĹÏʱĹčåƵĜƋĘƼŅƚųĜĵ±čĜűƋĜŅĹţ
QEKTMGGVSFSXGEV
X):kÚ±Ƌ±ŞĬŅƋƋåų
{ŅĬƼčų±ŞĘŅųŸåĜŸĵŅĵåƋåųũ
ĘĜŸÏŅŅĬěĬŅŅĩĜĹčŞųŅģåÏƋŞŅųƋų±ƼŸÚ±Ƌ±±ŸƋĘåĬĜĹåŅűčų±ŞĘØüŅų
±čųå±ƋĵŅƴĜåěĬĜĩååýåÏƋţFƋűŸ±ÏƋƚ±ĬĬƼ±ÆĬåƋŅƚŸå±ƴ±ųĜåƋƼŅü
ŸåĹŸŅųĜĹŞƚƋŸţ
QEKTMGGPIKSTPSXXIV
Creativebug
Creativebug Whatever kind of crafting you
AUTHOR
Maker mine
Wearable
Tech Projects
Useful resources
to improve your
making skills
Sophy Combine sewing skills with
AUTHOR
Dr Footleg
Hobby maker, father, STEM Ambassador, and… cave
explorer? Dr Footleg has a variety of interests
Zkdw#zdv#|rxu#Ľuvw#Udvsehuu|#
L
This chicken coop is ike a lot of great C64,” Footleg tells us. “When I Pi project?
fully automated
nicknames, Dr Footleg graduated, I thought working on A CamJam EduKit 3 robot with
is so named because of computers would be something I a Raspberry Pi Zero. From that
a simple mishearing of his would enjoy, so I bought a ‘teach start, I now have ten Raspberry
surname, resulting in a letter yourself to program in 21 days’ Pi robots, plus several more
addressed to Mr Footleg. After book and started applying for built from kits by children in
getting his PhD in Chemistry, he jobs 21 days later! I’ve always the after-school clubs I’ve run.
upgraded to Dr Footleg. enjoyed designing and making
“I studied science things. It used to be electronics, What’s your favourite thing
academically, but computers before creating designs using you’ve made with Raspberry Pi?
were a hobby right back to computers became a thing. My Mars Rover robot which I
my early teens when we got a After I discovered Raspberry Pi designed for the Pi Wars 2019
86 magpi.cc Dr Footleg
INTERVIEW
competition. It introduced me to
CAD and laser cutting, which I
had access to having just joined
Makespace Cambridge.
Dr Footleg magpi.cc 87
THIS MONTH IN RASPBERRY PI
MagPi
Monday
Amazing projects direct from our Twitter!
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!!
02a
02b
03
04
07
05 06
08
Halloween 01
projects 2021
Other amazing things from the community
Spooky community builds from
the scariest night of the year
In issue 111, we showed you how to upgrade your
Raspberry Pi projects to be Halloween-ready. Some
02
of our readers already had Halloween plans, and
showed us their morbid makes over on Twitter...
05
04
90 magpi.cc MondaysProjects
Coolest
Halloween
are
Projects
for Pico
online!
2021
THIS MONTH IN RASPBERRY PI
kck.st/3Gp6vG7 kck.st/3mxVDO9
YOUR LETTERS
Your
Letters
ų±ƴåĬƋŅÚĜýåųåĹƋĜŸĬ±ĹÚŸ±ĹÚÏųå±ƋåƼŅƚų
ŅƵĹųŅÆŅƋ±ƴ±Ƌ±ųرĬĬƵĘĜĬåĬå±ųĹĜĹčƋŅÏŅÚå
Bullseye benefits
One of my Raspberry Pi systems has been running for a
while using the Buster version of Raspberry Pi OS. I’ll
ghĽqlwho|#xvh#Exoovh|h#iru#ixwxuh#surmhfwv/#exw#lv#wkhuh#dq|#
real reason to update my other Raspberry Pi? It’s just a
Ľoh#vhuyhu1
Subscribe online:
Contact us! magpi.cc/subscribe
> Twitter @TheMagPi
> Facebook magpi.cc/facebook
> Email magpi@raspberrypi.com
> Online forums.raspberrypi.com Email: magpi@subscriptionhelpline.co.uk
SUBSCRIBE AND
SAVE UP
TO
35%
on the cover price
ISSUE #49
OUT NOW
hsmag.cc
COMPETITION
Competition magpi.cc 95
ACHTUNG!!!
The MagPi gibt es auch auf deutsch!
Features Editor
Rob Zwetsloot
RASPBERRY PI OS
rob@raspberrypi.com
Sub Editor
Nicola King
ADVERTISING
BULLSEYE
Charlotte Milligan
charlotte.milligan@raspberrypi.com
+44 (0)7725 368887
DESIGN
criticalmedia.co.uk
Head of Design
Lee Allen
Designers
Lucy Cowan, Sam Ribbits,
Ty Logan
Illustrator
Sam Alder
CONTRIBUTORS
David Crookes, PJ Evans, Ben
Everard, Rosemary Hattersley,
Nicola King, Phil King
PUBLISHING
Publishing Director
Russell Barnes
russell@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
BRAN Unit 6 The Enterprise Centre
NEW OD
Kelvin Lane, Manor Royal,
Crawley, West Sussex, RH10 9PE
S
+44 (0)1293 312193
magpi.cc/subscribe
Plus!
system which has been assessed as
conforming to ISO 14001.
station
Cambridge, CB4 0DS. The publisher,
editor, and contributors accept no
responsibility in respect of any omissions
Bringing it together
Sitting in the middle of a bunch of makers.
By Lucy Hattersley
I
’ve spent the last few days Computer Science platform (funded Ma^FZ`Ibmagazine has always tried
working with the new Raspberry by the DfE’s National Centre for to sit in the middle of this tribe. And
Pi Build HAT and some bumper Computing Education programme.) I’m not wholly convinced they are that
packs of bricks kindly supplied. Like It also makes a huge range of separate. After all, today’s hobbyist
most makers, I loved LEGO® as a kid. educational projects, which you will maker is tomorrow’s professional
Either when following instructions rffdvlrqdoo|#Ľqg#lq#Ma^FZ`Ib. developer. And most people who work
to build Technic trucks or working The Build HAT is one of those with computers enjoy computers on
free-form to build planes, houses, or fantastic products with a foot in both the side. You never stop learning.
‘abstract sculptures’. camps. Raspberry Pi Trading can be The engineering side of Raspberry Pi
LEGO hadn’t quite become the is growing, and we are increasingly
modern iteration: with its movie Twelve-year-old me coming across projects with a
tie-ins and themed sets. And it’s professional bent. I looked at the
been interesting to pick up LEGO would have loved this Midas display screen this month and
again at a later age, and discover just realised just how often I see screens in
how much of it has changed. Mostly rightly proud of developing such a stores, transport hubs, and on the
for the better. fantastic product, and the Raspberry streets. A huge number of them
One thing I love about Build HAT Pi Foundation is using Build HAT to moving forward are going to be
is that it bridges the gap between create incredible learning experiences powered by Raspberry Pi. Modern
Raspberry Pi the computer, and for children (of all ages). Adding the manufacturing facilities, storage
learning to code with Raspberry Pi. computing power of Raspberry Pi to areas, and delivery trucks are packed
This is the intersection where control LEGO with Python is sublime. with sensors feeding back data on
Ma^yFZ`Ibsits. I keep thinking ‘Twelve-year-old me heat, movement, and location. The
Many people don’t know that would have loved this.’ low-cost, low-energy requirements,
Udvsehuu|#Sl#lv#wzr#glļhuhqw# Still, you don’t have to be twelve and stable Linux support of Raspberry
organisations. There’s Raspberry Pi, years old to love LEGO. Frankly, you Pi make it perfect for these uses.
which designs and makes the can improve your coding skills at Wherever you are in your Raspberry
computers, and components like the any age, so why not have fun with Pi journey, you can be sure Ma^FZ`Ib
Build HAT. And there’s the bricks while you’re at it? pdjd}lqh#zloo#pdnh#hyhu|#hļruw#wr#eh#
Raspberry Pi Foundation, the charity there with you.
that works to put physical Engineering success
computing in the hands of people all There’s another intersection at work
Lucy Hattersley
AUTHOR
over the world. It runs the network in Ma^FZ`Ib. On the one side of a
of clubs and events and provides Venn diagram are the learners, the Lucy is editor of The MagPi and
computer science courses and makers, and hobbyists; and on the is hassling her cat with various
curriculum materials to students other the engineers, developers, and ÆųĜÏĩěƋĘåĵåÚƤåĹÚå±ƴŅƚųŸţ
H́Ɏɟ
H́˱ɿʡʄͽ̿ɟ
˱ǵˍΰφɟ
cdpstudio.com
ƗɟˍմڂֈԊԎڂԐԐԅڂԏԅڂԐԅԅڂڂʡ˱ɿ́ԺɂɎ̵ͮɟɂʎձɂ́˪
HSŴڂƗɟɂʎ˱́ˍ́ʄʡɟ͝ڂƉڂՄՄ˱ͽ ڂɎ͝ΞȘ̿ʄǵͮǵڂԏհڂԍԅԅԏˍڂɟ͝ͽ˱Ɏհڂĩ́̿ǵΰ
HIGHPI PRO
The new case from the HiPi.io team