0% found this document useful (0 votes)
78 views

Mag Pi 143

pdf

Uploaded by

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

Mag Pi 143

pdf

Uploaded by

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

YOUR OFFICIAL RASPBERRY PI MAGAZINE

Issue 143 July 2024 magpi.cc The official Raspberry Pi magazine

£5.99
07

9 772051 998001

A LL- N E W R A SP BERRY P I AI K IT RELEASE D


Industrial Raspberry Pi
ComfilePi
WELCOME

WELCOME
to The MagPi 143

R
obots are a true passion here at The MagPi. Few things
you make with computers have the same potential to
impress as a walking, wheeling, or even talking ‘bot.
The real skill isn’t just building a robot that rolls around,
but creating a smart rover that can sense its environment Lucy

EDITOR
and react accordingly. These rovers are sent into hazardous Hattersley
environments, or even to other planets. Lucy is the editor
of The MagPi
Our robot explorer feature (page 40) has everything you and her favourite
fictional robot is
need to get rolling. Marvin. But don’t
tell him. It’ll only
Have fun building your robot, and don’t forget to give it a bring him down.

name. And when you’re done check out the new AI Kit (page 8). magpi.cc
This new Raspberry Pi kit offers the potential to vastly speed
up artificial intelligence projects. We can’t wait to start making
with it, and I know our community will put it to good use.
Making intelligent robots is a childhood dream and, thanks
to Raspberry Pi, it’s now possible. I can’t wait to see what you
GET A
all make with it.
RASPBERRY PI
PICO W
Lucy Hattersley Editor
PAGE 38

magpi.cc 03
CONTENTS

Contents
> Issue 143 > July 2024

Cover Feature

40 Robot explorers 40

Regulars
08 World of Raspberry Pi
34 Case Study: Homey Pro
90 Your letters
92 Community events calendar
97 Next month
98 The Final Word

Project Showcases
12 Spin
16 Dicemaster 2000 16
20 Colour Word Clock
24 PUTTR
28 Math GPT
32 Retro Gaming Magic Mirror

20

Colour Word Clock Dicemaster 2000

The MagPi is published monthly by Raspberry Pi Ltd, 194 Cambridge Science Park, Milton Road, Cambridge, England, CB4 0AB. Publishers
Service Associates, 2406 Reach Road, Williamsport, PA, 17701, is the mailing agent for copies distributed in the US and Canada. 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 48 58
48 Add M.2 HAT+ to Raspberry Pi 5
52 Experiment with time in Python
58 Build a Raspberry Pi cash register

The Big Feature


Add M.2 HAT+ to Raspberry Pi 5 Raspberry
Xxxxxxxxxxxx
cash
64
74

Raspberry Pi success stories CrowPi

Reviews 84
72 PiDP0-10
74 CrowPi electronics kit
76 ED-IPC
80 Ten amazing cooking projects
82 Learn Java

Community
84 Brian O’Halloran interview
86 This Month in Raspberry Pi Brian O’Halloran interview

WIN RASPBERRY PI AI KITS 94

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

06 magpi.cc
Design

Code

Configure

Analyze

PR O FES S I O N A L CO N T R O L SYS T E M D E V E LO PM E N T TOO L

Home projects made easy.


CDP Studio, a great software development tool for your home projects. Build
systems for Raspberry Pi, use C++ or NoCode programming, open source libraries,
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
Tel: +47 990 80 900 • [email protected]
CDP Technologies AS // Hundsværgata 8, 6008 Ålesund, Norway
THE WORLD OF RASPBERRY PI

Raspberry Pi AI Kit
available now at $70
Discover neural networks and integrate AI into your projects with AI Kit.
By Naush Patuck

I f you’ve ever wanted to experiment with


the world of neural networks, artificial
intelligence and machine learning on your
Raspberry Pi 5, we have the perfect product
for you: the Raspberry Pi AI Kit. Developed in
collaboration with Hailo (hailo.ai), the AI Kit
offers an accessible way to integrate local, high-
performance, power-efficient inferencing into a
wide variety of applications. It’s available today
from our network of Raspberry Pi Approved
Resellers, priced at just $70 (approx £55).
The Raspberry Pi AI Kit comprises our M.2
HAT+ preassembled with a Hailo-8L AI accelerator
module. Installed on a Raspberry Pi 5 (magpi.cc/
raspberrypi5), the AI Kit allows you to rapidly build
 unning in real time,
R complex AI vision applications, running in real
time, with low latency and low power requirements.
with low latency and State-of-the-art neural networks for object

low power requirements detection, semantic and instance segmentation,


pose estimation, and facial landmarking (to name
just a few) run entirely on the Hailo-8L co-
S The Raspberry Pi AI
processor, leaving the Raspberry Pi 5 CPU free to
Kit disassembled perform other tasks.

08 magpi.cc Raspberry Pi AI Kit available now at $70


THE WORLD OF RASPBERRY PI

Key features of the Raspberry Pi AI Kit include:


• 13 tera-operations per second (TOPS) of
S A closer look at the
inferencing performance Here’s a preview of some of our demos that you Hailo module
• A single-lane PCIe 3.0 connection running can run through rpicam-apps: With the Raspberry
at 8Gbps Pi AI Kit, you are not limited to using the Hailo-8L
• Full integration with the Raspberry Pi image co-processor only in rpicam-apps or Picamera2.
software subsystem We also package an API integrated in the GStreamer
• Compatibility with first-party or third-party framework (magpi.cc/gstreamer) and native Python
camera modules or C/C++ applications. This also includes non-
• Efficient scheduling of the accelerator hardware: camera use cases, such as running inference on
run multiple neural networks on a single pre-recorded video files.
camera, or single/multiple neural networks with
two cameras concurrently Further resources
Our documentation for the AI Kit (magpi.cc/aikitdoc)
Hailo has created an extensive model zoo, where is a great place to start.
users can find a wide variety of pre-trained neural For full technical specifications for the Hailo-8L
network models ready to deploy and optimised to AI accelerator module, visit Hailo’s product web page
run on the AI Kit. (magpi.cc/hailo8lm2).
Hailo has created a set of advanced AI applications
The software (magpi.cc/hailopi5) running on a Raspberry Pi 5, and
A significant hurdle in creating real-world AI- also has a community forum (magpi.cc/hailodev)
T Object recognition: the
based vision applications is the software complexity for discussing topics specific to the Hailo-8L AI lemon Coke “bottle” is
of integrating the camera subsystem with the AI accelerator hardware and software tooling. controversial in these parts
framework. We have worked hard to simplify this as
much as possible. Our rpicam-apps suite of camera
applications (magpi.cc/camapps) now has a post-
processing template for integrating neural network
inferencing running real-time in the camera
pipeline. By using the pre-installed Hailo Tappas
post-processing libraries (magpi.cc/tappasgit), we
are able to create advanced AI-based applications
in only a few hundred lines of C++ code. Similar
levels of integration into our Picamera2 framework
(magpi.cc/picam2git) will follow soon.
The software installation steps are very simple.
Install a few packages through apt, reboot, and
you are ready to try out some of our AI demos in a
matter of minutes. The instructions can be found in
our getting started guide (magpi.cc/aikitstart).

Raspberry Pi AI Kit available now at $70 magpi.cc 09


THE WORLD OF RASPBERRY PI

M.2 HAT+ on sale


now at just $12
Raspberry Pi PCIe expansion board is now available.
By James Adams, Director of Hardware

T he new Raspberry Pi M.2 HAT+ enables


you to connect M.2 M-key peripherals,
such as NVMe drives and AI accelerators,
to your Raspberry Pi 5. It provides fast (up to 500
MB/s) data transfer to and from these peripherals,
and is available to buy today, from our network of
Approved Resellers, priced at just $12/£11.50.
Raspberry Pi 5 launched back in September last
year with an exciting new feature on board. No,
not the power button. Or the battery-backed real-
time clock. We’re talking about the PCI Express
(PCIe) expansion connector: this small 16-way FFC
(flexible flat cable) connector, positioned at the
extreme left of the board where the MIPI display
connector lives on older Raspberry Pi boards,
carries a single-lane (one transmit pair, one
receive pair, and one clock pair) PCIe 2.0 bus.
When we launched Raspberry Pi 5 we also
showed off a prototype HAT+, which bridged
between our FFC connector and the standard M.2
S M.2 HAT+ enables you
M-key form factor used by NVMe drives and many
to connect storage
devices, such as this other small PCIe devices. After several revisions,
256GB SSD drive, as
simplifications, and a whole lot of testing, that
well as PCIe devices
like the new AI Kit prototype became the product you see today.

10 magpi.cc M.2 HAT+ on sale now at $12


THE WORLD OF RASPBERRY PI

Developing great products takes time


Launching a new generation of Raspberry Pi
computers is a huge effort, absorbing the attention
of our engineering team. Raspberry Pi 5 was a
particularly complex (and expensive!) programme,
featuring three new custom chips (the Broadcom
BCM2712 application processor, Dialog/Renesas
DA9091 PMIC, and our own RP1 I/O controller);
new production processes (intrusive reflow for
connectors, and routed board singulation); and a
completely redesigned production test system.
So while in an ideal world we would have X Raspberry Pi 5’s
launched the M.2 HAT+ at the same time as PCIe slot
Raspberry Pi 5, it was important not to rush
things. There were still a few unresolved questions,
notably around the two “spare” pins on the  e wanted to make sure that our product
w
16-pin FFC connector. While these pins carried I2C
signals in our earliest prototypes, in the end the
really was a HAT+
Raspberry Pi PCIe Connector specification (magpi.
cc/pciedocs) allocates them to fixed functions: one
as a power enable for downstream device power, Extensive drive compatibility
and one as a board detect and wake signal. While we were doing all this, we took the
And we wanted to make sure that our product opportunity to test a wide variety of NVMe drives
really was a HAT+, which in turn meant we had and other peripherals, and to investigate the
to resolve a few last wrinkles in the Raspberry various issues we found. In one case we worked
Pi HAT+ specification (magpi.cc/hatplusspec). with a manufacturer to develop a fix for a drive
Raspberry Pi specifications, like our 40-pin GPIO that didn’t work correctly; this one turned out to
connector and our three-pin debug connector, be a startup timing issue in the drive firmware,
often become de facto standards for the rest of the preventing the PCIe controller inside BCM2712
industry, and we have a responsibility to get them from recognising the drive.
right first time. And of course it takes time to write firmware,
and to build the production processes, material
pipeline, and test systems required to build tens
of thousands of units of a product each and every
month. But with all this done, we’re pleased to be
in a position to launch. If your Raspberry Pi 5 has
up-to-date firmware, and an M.2 HAT+ attached,
an installed PCIe device will be probed at power on
and, if it’s an NVMe drive, it will be available as a
boot source.

Schematics
A nice side-effect of launching of the M.2 HAT+
a bit later has been all the third-party products,
such as the NVMe Base (magpi.cc/nvmebase)
from our friends at Pimoroni. We want to make
it easier to build high-quality PCIe accessories
for Raspberry Pi 5, and so we’re publishing our
schematics (magpi.cc/m2schem) as a reference
design. You can also browse our documentation
S Raspberry Pi ‘s M.2 HAT+ for the M.2 HAT+ online (magpi.cc/m2hatdocs).

M.2 HAT+ on sale now at $12 magpi.cc 11


PROJECT SHOWCASE

Spin
Ever wondered what death metal disco sounds
like? Spin will not only create it, but let you scratch
it, too, as Sean McManus discovers

“M y idea was to remove AI experiences


from black boxes and put them into
the physical world,” says Arvind
Sanjeev. “It’s an open invitation for people to
forget about the digital world and to try to create
something with AI.”
His previous project was Ghostwriter, a typewriter
Arvind which he converted to use text generator ChatGPT.
MAKER

Sanjeev Humans type their messages and Ghostwriter types


its replies onto the same sheet of paper.
Arvind is a design He wanted to create a family of devices and was
technologist who
loves to experiment thinking about where else AI has been disruptive.
between the “The latest music AIs have become so good that
boundaries of the it’s really hard to distinguish them from a human
physical and digital.
creator,” he says. “Spin is this curiosity tool that
magpi.cc/spin allows you to explore the boundaries of creating
music with AI. I took a lot of inspiration from
old analogue synthesisers and combined it with a
digital vinyl system DVS.”
Using AI platforms, you usually describe what you
want in text. “It’s hard for someone who’s using (including drums, sitar, and violin) but also the
it for the first time to come up with a really nice sounds of water, nature and opera. There are no
prompt,” says Arvind. “I wanted to bring as much constraints on how many buttons you select, or
physicality into this interaction as possible, rather what combinations you use. If you can’t decide,
than using a keyboard to type in what you want.” there’s a random button.
The duration of the music and tempo are set

Danger! Play that funky music using sliders. Knobs control the volume and
Mains Electricity At first glance, Spin looks like a record player. speed. “I thought: What are the maximum different
In fact, half of it is. The other half is a grid of kinds of physical interactions I can bring to this
This project involves buttons. One row allows you to select a mood, such device?” Arvind says.
disassembling a mains-
powered record player. as spacey, warm or dark. Two rows set the genre, When you press the generate button, your
including death metal, trance and jazz. Three rows chosen options are used to create music. When it’s
magpi.cc/
electricalsafety are dedicated to sounds. There are instruments ready, the record starts to rotate. “It is a signal or

12 magpi.cc Spin
PROJECT SHOWCASE

The record player controls


playback and is used for scratching

The user’s choices of moods,


genres, and sounds are used
to generate the music.

Quick FACTS
> Raspberry Pi stores
all the music files
to revisit later.
These knobs control the speaker volume
and speed of the record player motor > Meta trained
MusicGen with
20,000 hours of
licensed music.

> The record player is


a Numark PT-01.

> The Arduino Mega


has 54 digital input/
output pins.

> The project took just


under two months,
outside work.

W Raspberry Pi 4 is
mounted under the
record player. The
tiny HDMI screen is
shown bottom right.

Spin magpi.cc 13
PROJECT SHOWCASE

T Arvind removed
the record player
from its casing so it
would fit his cabinet.

invitation for you to listen to it,” says Arvind, “but He chose the Arduino Mega so he could be certain
in order to listen to it, you need to physically take he’d have enough input pins. “I always want a little
the needle and put it on the record.” By turning the more freedom,” he says. “I can use extra pins if I
record backwards and forwards (scratching), you want to add something in the future.”
can manipulate the sound. A keyboard matrix library takes the input from
the buttons and maps it as if it’s a keyboard. The
Leave a light on Arduino creates the text prompt for the AI by
Inside the cabinet, Spin houses an Arduino Mega, combining the words associated with the buttons
Raspberry Pi 4, and Behringer audio interface. There and the tempo and duration options. The prompt is
is also a speaker and a tiny HDMI screen at the back, sent to Raspberry Pi through a serial to USB cable.
connected to Raspberry Pi, to help with debugging. Arvind’s Python program on Raspberry Pi sends
The buttons have individual NeoPixel LEDs on the prompt to MusicGen, running in the cloud. “At
them (WS2812b) that light up when the button the time, MusicGen was one of the most flexible and
is selected. They’re illuminated in an animated creative platforms out there and it sounded relatively
pattern, using the FastLED Arduino library, good compared to others,” says Arvind. “The other
when the device is switched on, and 3D-printed models didn’t have openly accessible application
enclosures act as diffusers for the LEDs. programming interfaces that I could use.”
Arvind prototyped Spin on a breadboard, and
then used the open-source design software KiCad Spin me right round, baby
to design a printed circuit board (PCB). The PCB To play the music, Spin uses xwax, an open-
was made for him by a company in India. source digital vinyl system for Linux. This software

14 magpi.cc Spin
PROJECT SHOWCASE

Taking AI for a spin

enables DJs to control the playback of music files


using a normal turntable and a time-coded vinyl
record. “It gives them the ability to scratch any
music,” says Arvind. “Instead of having music in
the grooves, it has timestamps. If you listen to it, it
sounds like beeps or a sine wave.”
The signal is sent as audio to a Behringer audio
interface, which converts it to digital for Raspberry
The buttons are connected to the Arduino
Pi. Xwax decodes the incoming sound into the 01 Mega using a keyboard matrix. The Arduino
timestamps to control the music. receives your button choices, and turns them into
One challenge was that xwax uses a graphical a text prompt for AI.
user interface and can’t be controlled from the
command line. Arvind used a keyboard emulator
to simulate the keyboard shortcuts required to load
the new track and play it.
The project didn’t run entirely smoothly. “It
failed at the last point, when everything was in the
enclosure, even though I’d been testing in stages,”
said Arvind. “I thought it was a software glitch,
or it had something to do with the needle not
being sensitive enough now because it had been
running a long time. I took everything apart, piece
Raspberry Pi sends the prompt to
by piece, and tested it. There was a loose contact 02 the MusicGen AI model, running on
within the audio jack from the record player that I replicate.com. Raspberry Pi converts the audio
had to resolder.” from WAV to an MP3, which is played using the
xwax digital vinyl system.

I took everything apart, piece


by piece, and tested it

Arvind’s had queries from DJs asking if he’s


selling it, and he’s hoping to collaborate with
artists in the Bay Area when he relocates to
San Francisco shortly. He has no plans to start
manufacturing it, though, preferring to do
more experiments. “I would be happy to see
someone creating their own commercial version,”
he says. “That would be a nice thing to see in
the world.”
What’s his favourite combination? “I love lo-fi
The signal from the time-coded vinyl is sent
tracks,” says Arvind, “so I always start with a 03 as audio, through a Behringer audio interface
combination of peaceful, hip hop, lo-fi and some to the Raspberry Pi. Xwax converts this audio to
piano. But death metal orchestra and death metal timecodes and controls the playback.
disco are really fun to try.”

Spin magpi.cc 15
PROJECT SHOWCASE

The Dicemaster 2000


It looks like a game controller but for visually impaired people this
dice-rolling device is actually a game changer as David Crookes discovers

C hris Hall enjoys playing board games


and he’s part of a local gaming group.
He attends with his best friend and the
pair have had many happy times but a medical
condition affecting his pal’s vision has threatened
From the start, Chris had an idea of what he
wanted from the device. “I knew what I wanted
to achieve – for my friend to press buttons,
for virtual dice to be rolled and the result to be
announced,” he says. “From there it was just
to spoil the fun. “About a year ago, my best friend about figuring out which components to use and
was diagnosed with a degenerative eye disease,” how to lay them out efficiently. This needed to
Christopher says Chris. “So when his birthday was coming up, I be hand-held, so a compact design was a must.”
MAKER

Hall wanted to do something special for him.” To that end, Chris modelled the device on a
Most of the games played by the group involve gamepad. “I tried to imagine a controller, like an
Christopher Hall is the rolling of dice and the problem for his friend Xbox controller,” he says. “I sought to work out
a Senior Network
Engineer from was all too apparent: without someone reading out how it would look, feel and where the thumbs
Pikeville, KY, USA. the result, he wouldn’t know what numbers were would rest. I wanted to make something that was
He’s a maker at showing. The answer, Chris surmised, was a dice- comfortable and felt familiar and I also needed it
heart and lover of
rolling device that his friend could use independently to operate without being plugged in so I chose a
all things geeky.
which would read out the results and incorporate Raspberry Pi Pico and used an 18650 battery shield
magpi.cc/
dm2000 some other handy features. “I figured it would help to power it along with the other components.”
him out and be a surprise gift,” he tells us.
Roll with it
Selecting the Raspberry Pi Pico meant the dice
roller could be compact and use minimal power.
“It’s instantly on and it was able to handle the
different components I needed, such as a microSD
card reader, an audio amp with speaker and a
litany of buttons,” Chris says.
Those buttons would be 3D printed with Braille
so that his friend would be able to read their various
functions and control the device effectively and
independently. “Adding Braille wasn’t very difficult,”
Chris says. “I designed flat button caps then added
the Braille numbers to them in Blender, the free
open-source 3D computer graphics software.”
Board games often make use of non-traditional
dice – in other words, they’re not always familiar
cubes with six marked faces. The standard
polyhedral dice set also includes those with four,
eight, ten, 12 and 20 sides (the entire set being
referred to as d4, d6, d8, d10, d12 and d20). “I
S The device makes use of a Raspberry Pi Pico board
connected to a protoboard which is wired to the buttons needed to have a button for each one,” Chris says.
and a PAM8302 2.5 Class D single channel amp He also added two extras: Reset and Roll.

16 magpi.cc The Dicemaster 2000


PROJECT SHOWCASE

Quick FACTS
> It’s a handheld
dice-roller for visually
impaired people

> Each of the buttons


is imprinted with
Braille numbers

> It can mix and


Dicemaster 2000 doesn’t actually match six different
mean anything. “I always thought die types
it was funny when people talked
Each button to the left represents > Die pools can be
about future tech by slapping
the six dice in a polyhedral set. saved and loaded
2000 in the name,” Chris says
Four of them can be long-pressed
for extra functions > There’s a power
switch to save
battery life

To make the device easier to


hold, Chris added some grips
to the 3D-printed casing. It also
makes it look more striking

I designed flat button caps then added


the Braille numbers to them in Blender

The Dicemaster 2000 magpi.cc 17


PROJECT SHOWCASE

Writing the project in CircuitPython, he created


a device that would allow his friend to press one
of the numbered buttons to add it to the die pool.
When the dice are ready to be rolled, it’d be a case
of pressing Roll and listening to the result when it’s
announced. “In addition, there are some long press
modes,” Chris adds. “If you hold the d4 button for a
few seconds, you will enter quiet mode which plays
chimes rather than speaking out every die entered
and describing what it’s doing. It still announces the
results of the roll, but it can cut down on time and I
added it in case the normal mode was too distracting
to other players at the table.”
Holding down d6 saves the current die pool.
“This is useful if you’re playing something like
Dungeons & Dragons and constantly need to roll
that big 8d6 fireball [that’s eight d6 dice being
rolled at once],” Chris continues. “Long-pressing
d8 will load the saved die pool from the microSD
card, and that means the saved pool will persist
across uses.” Long-pressing the d10 enters
percentage mode which, rather than rolling dice,
will simply give a percentage between one and 100.

S The prototype
Dicemaster 2000
with its eight
buttons and 18650
battery shield
X As you can see, as
well as a rechargeable
battery and a lot of
soldering, the device
is neatly wired

18 magpi.cc The Dicemaster 2000


PROJECT SHOWCASE

Rolling the dice

Users press buttons representing the


01 six types of polyhedral dice (d4, d6, d8,
d10, d12 and d20) to add them to the dice pool.
Dicemaster 2000 will hold a pool of up to 20 dice,
either all the same type or a mixture.

Play the game S The case took some


time to perfect, but it’s
Coding all of this was a challenge. “Interfacing been designed to be
comfortable to hold
with the audio amp was tricky and I wish the while giving easy finger
device was a bit easier to understand in terms access to the buttons

of audio quality, but this may have been due to


everything being built on a prototype board,” Chris
laments. He also found it difficult to perfect the
Once the correct number and type of dice
controller shape. “The housing was 3D printed in a 02 have been added, the user presses the Roll
single colour and the top was painted red. I had a button. The result is verbally announced via the
good friend of mine help with the ergonomics of it. built-in speaker. If Roll is pressed again, the result
There was also a lot of soldering,” he adds. will be repeated. Reset empties the pool.
Even so, it’s been worth the time and effort.
Chris’ friend loves using the device and he finds it
allows him to fully participate in games. It’s also
comfortable to hold, easy to use and very effective.
What’s more, you can replicate it because Chris has
made the code open source and he has also shared
the 3D files on Printables (magpi.cc/dm2000files).
In that sense, it’s capable of helping many other
people with a visual impairment.
Chris is certainly happy overall even though
he would have done some things differently. “If
there is one part of this project I wish I had done,
it would have been to design a custom PCB using
The different modes make life even easier.
something like KiCad – if only I’d had issue 138 03 A die pool can be saved and loaded to a
of The MagPi [magpi.cc/138] when I started! It microSD card which is inserted in the top of the
probably would have helped a lot with audio issues device. The device can be made to talk less by
and made for a cleaner build overall. It’s definitely long-pressing d4 to make use of chimes instead.
on my list of things to learn for future projects.”

The Dicemaster 2000 magpi.cc 19


PROJECT SHOWCASE

Colour Word Clock


The GurgleApps siblings return to their roots with this fun and practical
word clock kit. Rob Zwetsloot spends some time with it.

G urgle Apps has been making fun


electronics projects (and tutorial!) videos
for years now, and we’ve included what
they’ve made in the mag several times. The three
siblings Amelie, Caleb and Zivya are back again in
“We wanted to make some kind of kit for people
to build and hack and remembered that fun little
project,” they continue.“[It] can be controlled via a
web interface on any device connected to the same
network. The clock displays the time in words and
these pages with a kit that you can actually build has a variety of display modes... It was important
yourself – the Colour Word Clock. to us that the code was open source and the kit
“One of our first ever projects was a tiny 8x8 was easy to build and modify. The kit is aimed at
LED matrix word clock using a Raspberry Pi,” the beginners and experienced makers alike. It was
siblings explain to us. “At that time we were too also important to us that the kit was affordable,
young to do it on our own, our Dad made it to teach and if you don’t want to buy the kit you can build it
us a bit of Python and electronics. We remember yourself using the open-source code and easy-to-
making little pictures on an 8x8 grid on paper then source components, and 3D-print the case. All the
turning it into binary then hex to get it to display case files are open source and free to download.”
on the LED matrix.”
You can still see the video on their channel:
magpi.cc/gurgleapps.
GurgleApps
MAKER

Amelia, Caleb,
and Zivya are the
three-person team
of GurgleApps, a
STEM YouTube
channel focusing on
electronics that has
been going for years.
They’re also siblings.

magpi.cc/
colwordclock

X The completed
kit, ready to tell
the time

20 magpi.cc Colour Word Clock


PROJECT SHOWCASE

LEDs light up the words


so you can read the time The black fascia
gives the project a
professional look

Quick FACTS
> This is not their first
product – that was
the Raspberry Pi
Pico Pinout Coaster

> You can still get the


code for the original
LED matrix used

> There’s a limited


run of white face
plates for the clock

> The code is being


updated with
features added by
the community

> They admit to


treating their Picos
pretty roughly,
but they always
keep working

Colour Word Clock magpi.cc 21


PROJECT SHOWCASE

X The white version was


requested by viewers

 e had to go to the Raspberry Pi Store in Leeds to


W
S The kit is compact
but comes with
get more Picos and had both 3D printers running
everything you
need for the build pretty much constantly to get more kits made
Reliable Pico with the I2C connection. We have so many Raspberry
The wireless capabilities of the project were Pi Picos lying around that we decided to try one of
extremely important to the siblings. those and it was bulletproof from the start.”
“We’d just open-sourced a MicroPython Web Like a lot of products, the clock went through
Server (magpi.cc/mpwebserver) to control projects many design changes – as you may have noticed, it
using a browser, and thought it would really show off definitely doesn’t ship with a tiny 8x8 LED matrix.
Warning! what it could do,” they say. “If you’ve seen any of our videos you’ll see projects
Hot solder
Despite their love of Raspberry Pi Pico (“we usually stuck together with Blu Tack and gaffer tape, but you
Soldering irons get very use Raspberry Pi Pico unless there is a specific reason can’t do that with a product you’re going to sell,”
hot, and stay hot for a
to use something else,”) they began experimenting they admit. “We went through hundreds of different
long time after they’re
unplugged. Make with another microcontroller, however it just designs and prototypes. The 3D-printed faceplate
sure that you put the
iron in the stand when couldn’t hack it. alone we tried with dozens of different fonts, sizes
you’re not using it and “We found the Wi-Fi connection degraded when and colours. Dropping the small 8x8 LED matrix was
don’t touch the metal
parts – even after it’s we left it running for a few days, we went through a big decision, we had to start again with the code
unplugged. four different [microcontrollers] and they all had the and the faceplate. We had to make the clock bigger to
magpi.cc/soldering same issue,” they explain. “At this stage the clock fit the larger LED matrix and completely redesign the
was still a tiny 8x8 LED matrix word clock which case but it started to come together and look like a
used I2C and SPI, and we also had intermittent issues product we’d be proud to sell.”

22 magpi.cc Colour Word Clock


PROJECT SHOWCASE

Rave reviews Layers of fun


Like Raspberry Pi itself, GurgleApps had modest
expectations for the Word Clock – and they were
completely smashed.
“We only had 10 kits and they sold out
immediately,” they say. “We had to go to the
Raspberry Pi Store in Leeds to get more Picos
and had both 3D printers running pretty much
constantly to get more kits made.
“What we are most pleased about though are
the comments and support from people who have
bought the kit. We’ve been astounded by the way it
has been hacked and modified by people who have
bought it. A teacher sent us a photo of him using it
in class to teach English. Pretty quickly we’d seen
You’ll need to solder the correct wires to
the clock doing things we’d never thought of. The 01 Raspberry Pi Pico and then to the LED
ingenuity of the people who have bought the kit has board – there’s only three to worry about though.
been amazing. We’ve had something new to show
every week on our Sunday live streams and get to
chat to the people who have built their clocks.”
Rob has one ready to build for his office desk,
a topic you may remember causing him some
T The complete Word Clock
concern in a previous issue’s Final Word. We hope is a great looking accessory
they make their way to desks around the world. to your techy desk

Much like a Pimoroni PiBow, you assemble


02 the case up in layers, starting with the
faceplate with the words on.

Add the backplate to secure Pico and


03 you’re ready to go – you’ll just need to add
the software and turn it on.

Colour Word Clock magpi.cc 23


PROJECT SHOWCASE

Puttr
Getting good at golf without the green fees with a bit of help
from Raspberry Pi? Rosie Hattersley wants to know more

E xecutive boardrooms up and down the land


are (according to urban myth or business
tropes) stuffed to their expensive gills with
bag after bag of golf clubs; their owners while
away the working week so they can head off to
the fairway and execute some impressive swings
and putts.
Matthew What joy to learn of a miniature putting mat
MAKER

Allard that puts those otherwise idle clubs to good use


mid-week too. Puttr (puttr.co) makes excellent use
Puttr CEO Matthew
of Raspberry Pi 4 and an HQ Camera to determine
has worked on
mobile software and whether a putt is made or missed, logging results
for AOL on smart on a linked app.
home development. Like many great ideas, Puttr came about because
This is his first
Raspberry Pi project. of some enforced downtime during lockdown.
Entrepreneur and founder of several successful
puttr.co
start-ups Matthew Allard had been on the golf
team at university, and lockdown had him
contemplating an at-home putting game that
he and his son could both enjoy. Matthew had a
personal interest in how software and computers
can interact with the real world, and having taken
post-graduate courses in embedded systems was
keen to make use of what he’d learned.
One thing Matthew knew already was that
“putting practice is boring and lonely” (don’t they
have crazy golf courses in the US?) yet it accounts
for 42% of time golfers put in. Creating a means to
connect fellow golfers and ‘gamify’ putting could
transform this rote activity and allow members
of the golfing community to challenge each other
with online tournaments.

Hits and misses


X The 3D printed and Matthew originally aimed to track made and missed
injection moulded
case doubles as a
putts via an app using sensors in the hole of an at-
storage case home putting mat hooked up to GPIO pins. However,

24 magpi.cc Puttr
PROJECT SHOWCASE

Quick FACTS
> The hole in a golf
course is only 2.5x
the diameter of
the ball

> Off-course golfing


exceeds on-
course golfing

> Adjustable legs


help ensure the
A perfectly flat putting mat
playmat is fully flat
is vital: the camera comes
in useful again here, lighting > While Raspberry
up an LED when alignment Pi’s camera
is just right provides a visual
confirmation...

> ...then automatically


connects putting
mat to phone
via Bluetooth

Puttr uses Raspberry Pi 4 and a


wide-angle camera to detect
‘made and missed’ putts,
gamifying an otherwise repetitive
aspect of golf practice

Shots can be taken from


different places on the 11–foot
putting mat, with results logged
to the Puttr app and optionally
shared with followers

Puttr magpi.cc 25
PROJECT SHOWCASE

he soon discovered this approach was limited: “I user able to access stats on their performance and
could detect when a ball went in the hole, [but] optionally share it with other Puttr users.
I couldn’t detect missed putts.” Next, Matthew Raspberry Pi quickly proved a great choice,
tried break-beam IR sensors to get more precision since it offered an operating system with all
and measure missed putts, as well as ‘makes’, but the tools he needed for the software along with
“quickly realised that any sun exposure would cause good value hardware that worked well together.
false positives in the break-beam”. “Many suppliers tried to talk me into creating my
A friend tipped him off about Raspberry Pi, and own board [but] there were many reasons to use
Matthew soon saw he could use computer vision Raspberry Pi.” The camera connection, Bluetooth,
and a wide-angle lens to detect the location of the Wi-Fi, and processor were all included. Matthew
physical hole, then track any golf ball that passed was also encouraged by the strong community keen
T Putts can be
its field of view. Once a ball has entered or exited, to help with any troubleshooting he might need,
attempted from it sends the full ball path data over Bluetooth to given this was his first ever Raspberry Pi project.
multiple distances
with balls returned
a connected app on an iOS or Android device, he
down a chute explains. Details of each putt are logged, with the Embrace the light
At first, Matthew stuck with his infrared break-
beam idea, testing it in his garage in the evenings
after long days at his day job. There were “a ton of
tweaks” to get the computer vision to work well
under different lighting conditions. Eventually, it
seemed as though the beams were working just as
he expected. “I would get a break when the ball
enters the ramp, and another one when and if it
entered the hole. Perfect!”
Replicating results when demonstrating
the embryonic Puttr game to his son was less
successful. In fact, it didn’t work at all in daylight.
Matthew eventually realised that sunlight hitting
the beam’s receiver was preventing the circuit
being broken even when a ball passed through

X Putting mat and


chute roll up and are
storage in the self-
contained Puttr box

26 magpi.cc Puttr
PROJECT SHOWCASE

Pitch for perfection


it because it emits infrared rays of its own:
“Apparently I missed that in school!” Connecting
Raspberry Pi 4 to a GATT server (for Apple devices)
as a headless Bluetooth peripheral meant code
pairing was not an option. Instead, Matthew
created a Bluetooth Write Characteristic that can
receive a Wi-Fi SSID and password specifically for
the task. He then wrote all the computer vision
code and app software to make Puttr work.

T he Puttr app has logged


more than a million putts
Prototyping involved laser-cutting Baltic
birchwood, and Matthew’s first foray into 3D
design and printing using CraftCloud to create the
box used as both ball tracker and holdall, the ramp,
Creating a putt-tracker involves mounting
and ball return chute. The clever design is portable, 01 Raspberry Pi 4, an infrared lens and wide-
with the mat rolling up inside. angle camera lens in a case (Puttr’s was injection-
Matthew praises the “stable, tested OS, camera moulded). Custom computer vision code for
interface, Bluetooth and Wi-Fi, and says choosing Raspbian Buster Lite OS discerns successful putts.
Raspberry Pi meant R&D took at least a year less
than choosing a different setup with costs that
would have been much higher. New versions and
applications are already planned. Since launching
18 months ago (after a successful Indigogo
crowdfunder), the Puttr app has logged more
than a million putts. The clever take on pitch and
putt now has worldwide league tables, games and T The Raspberry Pi camera
tracks the golf ball as
challenges, with a subscription model for golfers it approaches the hole,
keen to pit their skills against others. logging whether it is putted

The box also contains a printed circuit board


02 and a USB LED light placed above the golf
hole, plus a break-beam laser mechanism triggered
by the golf ball rolling into the hole or running wide.

The Puttr app automatically connects the mat


03 to the phone or tablet via Bluetooth and records
statistics for each player’s putting average.

Puttr magpi.cc 27
PROJECT SHOWCASE

MathGPT
A fun way to learn maths, powered by Raspberry Pi
and AI. Rob Zwetsloot sees if it adds up

T he uses of LLMs with Raspberry Pi have


been quite staggering – many of which
we’ve covered here in the magazine.
From recipe bots to interactive story tellers, and
compliment givers to fortune tellers, the uses seem
endless. Maker Divya Chandana has brought us a
new one: an educational toy that helps children
Divya learn maths.
MAKER

Chandana “Unlike traditional math exercises, this


interactive game transforms equations into
A Texan senior relatable scenarios, such as ‘two candies + three
software developer
who also loves candies,’ and can dynamically change objects
to collect rocks with each question to maintain engagement and
and crystals, build curiosity,” Divya tells us. “The game utilises
LEGO, and explore
ChatGPT to generate questions, seamlessly
technology
adjusting difficulty as children progress in the
magpi.cc/
mathgpt game and featuring arithmetic operations including
addition, subtraction and multiplication.”
It’s built in a fun LEGO facade, with LEDs letting
you know if your answer was correct or not. This
provides immediate feedback ‘without punitive
scoring’ says Divya, and allows kids to keep trying
until they succeed.
“As children conquer level one with all correct
answers, they unlock subsequent levels for
continuous learning and enjoyment, devoid of
penalties or restrictions,” Divya explains. “The idea
started when I noticed my neighbour’s kid having
a tough time with maths, especially with numbers.
X Divya with her
creation – it’s not
When I switched the questions to use objects
quite all enclosed yet instead of just numbers, like talking about apples

28 magpi.cc MathGPT
PROJECT SHOWCASE

The lights are used to


let the child know how
they are progressing

The screen shows


the questions
created by the LLM

Quick FACTS
> Currently answers
are input via a
keyboard

> A traffic light system


is used to indicate
to the child of their
progress...

> … with yellow


showing the
transition to the
Divya made use of her love of LEGO next level
to build the enclosure of the device
> The code is open
source

> The LLM API used


is gpt-3.5-turbo

W Even if you get the


answer wrong, you
can try again – it’s a
non-punitive scoring
system as well
W Multiplications
are also included
for slightly more
advanced questions

MathGPT magpi.cc 29
PROJECT SHOWCASE

 aspberry Pi also makes integrating ChatGPT


R
straightforward, allowing for the use of AI
technology without complications

30 magpi.cc MathGPT
PROJECT SHOWCASE

A game of maths
or toys, it was like [a switch turned on]. Suddenly,
they could picture it in their mind and come up
with the answers. It made me see how this kind of
approach could help with visual, verbal, and logical
thinking. I thought if one kid was struggling,
there might be others facing the same issue. So, I
decided to create a fun and engaging way to learn
maths, using what I had learned to help kids grasp
the concepts more naturally.”

Wrangling an AI
Divya broke down the build process into
Turn it on and Math GPT greets you, ready
multiple parts: conceptualising and design, 01 to start giving you questions. Input is
game mechanics, software and AI integration,
currently made via a keyboard.
choosing the hardware, programming, and
testing. With the concept and game mechanics
already sorted, she began designing the prompts
to be used. “Designing the prompts for the
OpenAI API was crucial,” Divya tells us. “The
prompts needed to be carefully crafted to generate
questions that are age-appropriate, engaging, and
varied in difficulty.”
Raspberry Pi became the computer of choice for
the project after this initial development.
“I chose Raspberry Pi 4 for this project because
it’s affordable and portable, making it an excellent
option for a setup that can be easily moved
around,” Divya explains. “Raspberry Pi also makes
Correct answers to the questions posed via
integrating ChatGPT straightforward, allowing for 02 ChatGPT light a green LED to let you know
the use of AI technology without complications. you’re going on to the next question. Wrong answers
Plus, it’s simple to connect hardware like the LCD result in a red, but you’re allowed to keep trying.
display and LED lights to Raspberry Pi.”
After testing and refining her program, she built
the very striking LEGO enclosure. “This hands-
on approach not only protected the electronics
but also added a playful, tactile element to the
project,” Divya says.

Next steps
The project works perfectly in its current form,
with Divya quite proud of how the user interface
is easy to use. She’s not done yet though.
“The next iteration, MathGPT2, aims to
introduce story-based math problems,” Divya
says. “This approach will make learning even more
engaging by weaving arithmetic operations into
compelling narratives, allowing children to solve
math problems within the context of stories.” At the end of the level, your score is tallied and
She also plans to add multilingual support, and 03 you go onto the next level. Questions become
X With Math GPT on wheels
even voice support starting with text-to-speech it looks like it truly is
harder, yet are still suitable for children.
and maybe moving onto voice input too. portable, like Raspberry Pi

MathGPT magpi.cc 31
PROJECT SHOWCASE

Retro gaming
magic mirror
David Edwards’ magic mirror gives information about the present and future
while also providing a blast from the past, reflects David Crookes

M any hobbyists have used Raspberry


Pi to create a magic mirror or a retro
games console. But, as David Edwards has
shown, it’s possible to do both at the same time,
taking the concept of a magic mirror and a console
“Unfortunately, the curse of the early adopter
struck, with RetroPie and PINN not having official
support for Raspberry Pi 5 at the time,” David
says. “It took some time to get PINN working at all
and, even then, I think Raspberry Pi 5 support was
to a whole new, playful level. questionable.” David switched to Recalbox which
“I have long wanted to build a magic mirror,” was installed on one partition. Another partition
David David says. “It’s a great way to access common was used for the magic mirror functions.
MAKER

Edwards information that would otherwise be locked on a

David Edwards
smartphone. I have also liked wall-hanging small
arcade machines, but I have neither the space or
I wanted the mirror to
has been tinkering
with electronics
from a young age
permission to install one! The solution, for me, was
to combine both concepts into one device.”
play as many gaming
and he presents
insightful videos for
With that in mind, he went big. And we mean platforms as possible
really big. He took a 65-inch touchscreen and
Element14.
connected it to a Raspberry Pi 5 computer, figuring
magpi.cc/
retromirror games would look amazing across such a large
display. It also enabled David to create a full-
length mirror, despite it posing
issues of its own.
“Working with such a large
display was a challenge due to the
physical weight of moving and
manipulating it,” he explains. “I
think it weighed 48kg so I really
shouldn’t have been lifting it on my
own. I was afraid I would break it by
letting it flex, cracking the screen.”

Looking good
Initially, David tested the concept
using a Raspberry Pi 3 computer
and an official Raspberry Pi
seven-inch touchscreen. He played
around with PINN, a version of the
NOOBS operating system installer, S The display activates
and sought to get everything when someone
walks in front of it,
S With no information being displayed nor any game
working with RetroPie before showing the time,
being played, the device is a simple, full-length mirror ordering the larger equipment. date and more

32 magpi.cc Retro Gaming Magic Mirror


PROJECT SHOWCASE

David had trouble getting


the screen to display
horizontally so there was
some initial neck-craning As with all magic mirrors, the display
is covered with a mirror film which
David says he needs to reapply

Quick FACTS
> It uses Raspberry
Pi OS’ Magic
Mirror app

> Game emulation


is accomplished
via Recalbox

> It’s fitted with


Raspberry Pi 5
The 65-inch display’s bezel is thicker at
> The system
the bottom which meant the size and
draws about
shape of the frame was tricky to perfect
200W of power

> So it only activates


“I wanted the mirror to play as many gaming when someone is
platforms as possible,” David says. “To achieve this close by
I figured I needed the most processing power, and
the Raspberry Pi 5 seemed the best way to go. So
far it has proved more than capable of emulating
games on many platforms without much trouble.”

On reflection
David also added motion-sensing using a PIR
sensor. When someone walks in front of the
sensor, the screen turns on. When the person
moves away, it turns off. The display also turns
off at night and comes back on in the morning,
using the Raspberry Pi OS’ Magic Mirror app to
show the weather forecast, a calendar and more.
The build also includes an RS232 converter so
that the Raspberry Pi’s Universal Asynchronous
Receiver/Transmitter (UART) can be converted
for serial communications.
When you want to play, controllers can be
connected via Bluetooth Low-Energy or USB, and
the games look a treat on such a large screen.
There is still room for improvement, however. “I
still need to get around to reapplying the mirror
film again,” he says. “I’d also like to spend more
time with the plugins to the magic mirror platform,
maybe even develop a couple of my own to make W When assembled,
the best use of the screen real estate available. the magic mirror
dual boots between
Maybe in the future there is scope for a camera, Raspberry Pi OS
facial recognition and a multi-user experience.” and Recalbox

Retro Gaming Magic Mirror magpi.cc 33


SUCCESS STORY

SUCCESS STORY magpi.cc/success

Homey Pro
smart home hub
An advanced hub that makes smart home systems smarter,
more customisable, and easier to control. By Phil King

P owered by Raspberry Pi Compute Module


4, Homey Pro (homey.app) gives users a
single interface to control and monitor all
their smart home devices from different brands.
It does everything on the local network, not in the
The latest in the line is the new-generation
Homey Pro smart home hub, based around
Raspberry Pi Compute Module 4. Designed to be
compatible with “practically all” smart devices, it’s
packed with modules and antennas to support a
cloud, for the lowest latency, highest reliability, wide range of communications protocols.
and strictest privacy. Homey Pro enables users to control their entire
Athom was co-founded in 2014 by Emile Nijssen smart home from one place with a smartphone
and Stefan Witkamp in The Netherlands, launching app or web dashboard. Home automations can
its first Homey device, a smart speaker / home also be programmed via an easy-to-use card-
hub, via a Kickstarter campaign. Since then, the based ‘Flow’ system, with no coding knowledge
company has released a series of Homey models required. A large community of users share their
T The Homey Pro
with ever-increasing processing power and more Flow creations with others, and even publish apps
Smart Home Hub advanced feature sets. to the Homey App Store.

The challenge
 omey Pro has a wide target audience:
H “With Homey Pro we really wanted to make the
world’s most advanced smart home hub,” says
anyone with smart devices who wants co-founder and creative director Emile Nijssen.

to automate their home “We always try to strike a balance between user-
friendliness and polished design… but also very
advanced software. So our customers can go really
deep and customise many things, but still without
sacrificing usability. That’s the main reason our
customers choose Homey instead of open-source
projects or limited stuff like big tech delivers. They
want the best of both worlds.”
The new-generation Homey Pro was in
development for over two years and is built
upon the architecture of Homey Bridge, released
in 2022 to add local wireless connectivity to
earlier Homey models. To work with the widest
possible range of devices, it supports numerous
communications systems, including Zigbee,

34 magpi.cc Homey Pro smart home hub


SUCCESS STORY

W Raspberry Pi
Compute Module 4
inside the Homey Pro

Z-Wave, Wi-Fi, Bluetooth, 433MHz RF, infrared, Instead, the team was able to focus specifically
and Thread. on the excellent smart home functionality they
One challenge was to fit all the necessary aimed to offer.
antennas and modules into the device. “We didn’t Integrating Raspberry Pi Compute Module 4 into
want it to look like a gaming router with all these the design was straightforward, he says. “It’s well
antennas sticking out,” says Emile. “So getting documented. The software is readily available. And
that right took a long time. And we also wanted to that’s something I’m very proud of: we did really
profit from the development that we did on Homey build on the booting software so that the Pi turns
Bridge. So actually while designing Homey Bridge, into USB mode so you can flash it with software. And
which is sort of a light version of Homey Pro, even we built this beautiful website around it so you can
if you look at it from the outside, we already were actually flash your Homey Pro within the browser.”
thinking about how we could put our own carrier Most of the other electronics within the device
board on top of it that could carry, for example, a are communication modules. “We have Zigbee and
Compute Module.” Doing this would offer a way Thread. They share a radio, and we have a Z-Wave
to support all the communications modules that chip, and we have a 433MHz modem from Texas
were needed, while providing a mature software Instruments.” There’s also an infrared LED to
environment that would help the team build a rich transmit IR data, along with an RGB LED ring to give
and frictionless user experience. feedback to the user. Everything is connected to a
Raspberry Pi Compute Module 4, which also controls
The solution an ESP32 board to talk to some other peripherals.
“At the point in time when we were designing, the
Compute Module was a perfect candidate for what Why Raspberry Pi?
we wanted to do because the time to market is “I’ve always had my eyes on Raspberry Pi from
faster,” recalls Emile. “We didn’t have to reinvent the beginning,” reveals Emile. “So finally when
the wheel to build a small Linux computer.” the Compute Module 4 with Wi-Fi and Bluetooth
was announced, we jumped immediately on it.
I think like one day after the announcement I
called my electrical engineers and said, you have
to throw everything you did in the trash and we’re
switching to this right now.”
He says the main advantage of using Raspberry Pi
is the software support. “I mean there are a lot of
Linux boards out there, but they come with a ‘build
your own device tree’ kind of vibe. So the Raspberry
Pi community is amazing. There’s a lot of stuff
already done before you. For the Compute Module
itself, it strikes a pretty good balance between W The Homey Pro
functionality, form factor and cost.” Insights Dashboard

Homey Pro smart home hub magpi.cc 35


SUCCESS STORY

W Creating advanced flows in


the Homey Pro web app
T Controlling devices
from Homey Pro’s
smartphone app

The results actively working on new energy solutions that give


Homey Pro has a wide target audience: anyone customers insights and help them actively save
with smart devices who wants to automate their energy, and not only save, but also balance their
home, but doesn’t want to spend too much time energy usage, because that’s really what’s hot right
setting it up. “They want something that works now in the market.” To that end, the Homey Pro
out of the box and then they can start to play with system enables you to monitor energy usage in
it and go from there,” explains Emile. “I’d like your home by different devices. “You can see their
to call them nerds with taste. So people who just energy usage. You can also see beautiful charts of
enjoy a great product that’s polished, that has a all your devices [and] sensors.”
lot of love in it.” It also makes it easier to use a Another appealing aspect for many customers is
wide range of smart devices without the need to that Homey Pro is very ‘privacy first’. “We don’t
resort to multiple smartphone apps: “That’s where sell data. We’re a simple company. We make a
Homey comes in to make a great experience by great product that we ask some money for, and
bundling those devices.” then you’re done. So it’s very straightforward. So
Emile notes that it’s easier to set up and use especially if you compare [it] to big tech, that’s a
than an open source solution such as Home big reason why people choose Homey over Google
Assistant, saying that users “switch to something Home, for example – not only because it’s more
like Homey Pro because it’s a commercial product advanced, but also because they want their home
that works out of the box, but they still have the to feel safe.”
freedom to configure it as they like”.
The latter is achieved using
Flow automations. “You have all
these cards that you can drag and
drop; when the last person left
the home, and it’s during the day,
then turn off all the lights, for
example. So it’s very easy. And
it’s drag-and-droppable. You can
draw lines between these cards. So
it’s basically programming, but it
doesn’t feel like programming.”
Emile says that monitoring
energy usage is becoming more
and more important. “We’re very

36 magpi.cc Homey Pro smart home hub


Raspberry Pi Custom DSI Display
CM4 Carryboard, and Industrial Tablet

Custom DSI Displays

Development of Industrial Tablet


CM4-compatible carryboard development capabilities

Looking for cooperation Contact us


Tel: +44 7587611960
partners around the E-mail: [email protected]
world. Website: www.jmolcd.com
SUBSCRIPTION

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

Exclusive Offers
Great gifts, offers, and discounts

Great Savings
Save up to 23% compared to stores

Subscribe for £10


Free Pico W
3 issues of The MagPi
£10 (UK only)

Subscribe for 6 Months


Free Pico W
6 issues of The MagPi

+ £30 (UK)
€43 (EU)
$43 (USA)
£45 (Rest of World)

Subscribe by phone: 01293 312193


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

38 magpi.cc
SUBSCRIPTION

SUBSCRIBE TODAY AND GET A


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

A brand new RP2040-


based Raspberry Pi Pico W
$6
development board

Learn to code with


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

Buy now: magpi.cc/subscribe

SUBSCRIBE
on app stores

magpi.cc 39
FEATURE

With a rugged robot, equipped with wheels


or legs, you can explore the surface of a planet
and use sensors to analyse its environment

By Phil King

W
hether on another planet, or our own, robot rovers are
commonly used to explore hostile environments too dangerous
for humans. Equipped with a camera and various sensors robots
can analyse the environment and detect dangers. Some even have a robotic
arm to manipulate objects.
You can build one of these robots from the many Raspberry Pi robot kits
available! These are smaller, and more affordable, making it easy to get involved
with robotics from a safe standpoint. Here, we take a look at some of the best,
from starter kits to more feature-rich builds such as the 4tronix M.A.R.S. Rover
that can handle outdoor terrain. Let’s start exploring…

40 magpi.cc Robot explorers


FEATURE

Starter Robots
If you’re new to robotics and want a simpler project
to get started with, why not build one of these kits?

CamJam EduKit #3 magpi.cc/camjamedu3 £20

One of the most affordable starter kits around, it includes the components
needed to build your first wheeled robot, including a motor controller board,
two DC motors and wheels, ball castor, mini breadboard, jumper cables and
resistors. You even get a couple of sensors: ultrasonic for obstacle detection,
and a line follower to track black lines marked on the floor.
The only thing missing – apart from a Raspberry Pi and four AA batteries to
power it – is a chassis. You can either buy one or use the kit’s cardboard box.
Detailed online worksheets, based around Python 3 and GPIO Zero, take
you through building and programming the robot, including getting it to
move autonomously.

W This entry-level kit is ideal for beginners and even includes a couple of sensors

Pi2Go Mk2 magpi.cc/pi2go2 From £43

In the standard Pi2Go kit, you get everything apart from a Raspberry Pi and
six AA batteries – if using a Raspberry Pi 4 or 5, you’ll need to switch in a
2 × 18650 battery board. There’s also a 4WD pack option to convert it into a
four-wheeled robot.
The main motor driver board is packed with sensors: four analogue light
sensors, two infrared, and two line-followers. Two breakout slots let you connect
the supplied ultrasonic distance sensor and it includes a four-digit display,
although you could switch these out for other Breakout Garden-standard sensors.
An extra 12-pin connector enables you to add up to four servos too.

W This two (or four) wheeled robot is packed with features and sensors, plus expansion options

Trilobot magpi.cc/trilobot From £53

Described by Pimoroni as a ‘mid-level’ robot, the Trilobot is designed to be


simple for newcomers to get started with while offering plenty of possibilities
for adding extra functionality via numerous ports and headers.
The standard Base Kit includes everything you need apart from a Raspberry Pi
4, USB-C power bank, and optional Camera Module. The main PCB seamlessly
integrates a DRV8833PWP dual H-bridge motor controller, connected via short
cables to the pre-soldered shims of the metal-gear motors. Two moon buggy
wheels are supplied alongside a metal ball castor for the rear.
While not yet compatible with Raspberry Pi 5 (or Raspberry Pi OS based on
Bookworm), the Trilobot is a terrific two-wheeled robot that even features
six RGB LEDs for cool underlighting effects.

W The supplied ultrasonic distance sensor and optional Camera Module are mounted at the front of the robot

Robot explorers magpi.cc 41


FEATURE

Explorer Robots
Start exploring the outdoor terrain of the planet with one
of these robot kits, many equipped with multiple sensors

Tiny 4WD magpi.cc/tiny4wd £55

The Tiny 4WD’s design originated in a tutorial written for The MagPi many
moons ago, but this is a much-improved version. Controlled by a Raspberry
Pi Zero W (not supplied), this mini robot is sturdy and powerful enough to be
used outside, even on gravel paths.
The kit contains all you need to build the chassis, including a mount for a
Camera Module, while a Pimoroni Explorer pHat drives four motors that spin
the large grippy wheels. A mini breadboard is also included, enabling you to
add optional sensors.

W One of the smallest robots around, the Tiny 4WD is a mini marvel that can handle the outdoors

PiCar-X magpi.cc/picarx $82 (£64)

One of SunFounder’s range of PiCar kits, it has four chunky wheels and
is crammed with features including ultrasonic distance and line-follower
sensors, a built-in speaker, rechargeable custom battery pack, plus a camera
with a servo to rotate it. By streaming live video, you can get a first-person
view from the robot. The PiCar-X is programmable in Python or Blockly
– online guides and videos help you get started. AI computer vision enables
the robot to drive itself and recognise objects, faces, and hand gestures.

W Packed with features, this is one smart car – with text-to-speech, it can even talk

Zumo 2040 magpi.cc/zumo2040 £150

A classic method for navigating tough terrain is to equip a vehicle with


caterpillar tracks. That’s the case with the Zumo 2040 from popular robotics
brand Polulu. As the name suggests, it’s powered by an RP2040 chip, as
featured in Raspberry Pi Pico. So it’s easy to program using MicroPython,
C/C++, or the Arduino language. At just 10cm long it’s small, but is jam-
packed with features including four proximity sensors (on the front and
sides), five downward-facing reflectance sensors for line following or edge
detection, and even a built-in IMU (inertial measurement unit).

W This mini tracked robot can navigate difficult terrain while using an impressive array of sensors

42 magpi.cc Robot explorers


FEATURE

TurboPi magpi.cc/turbopi $190 (£149)

When it comes to manoeuvrability, Mecanum wheels are the ultimate upgrade,


enabling a vehicle to move sidewards and spin around on the spot. That’s why
they’re used on some forklift trucks. As well as offering 360° omnidirectional
movement, HiWonder’s TurboPi car carries an HD camera on a pan-tilt
mount. This can be used with the OpenCV Python computer vision library to
recognise objects and react to hand gestures. There’s also a four-channel line
follower sensor and a smartphone app for remote control.

W Mecanum wheels make this one of the most manoeuvrable Raspberry Pi robotic rovers

TonyPi magpi.cc/hwtonypi $570 (£447)

Not every robot moves about on wheels – some have legs, like this amazing
mechanical humanoid from HiWonder. Powered by Raspberry Pi 4, the TonyPi
has a built-in IMU (inertial measurement unit) to help maintain its balance
as it walks around – it can even get up from lying on its back. It also boasts a
pair of robotic arms with gripping hands to pick up objects. Equipped with an
HD camera, its head can tilt and pan to see around. With computer vision, you
can get it to recognise and track objects, enabling it to kick a football.

W This impressive humanoid robot has AI vision, gripping hands, and the ability to walk

RaspClaws magpi.cc/raspclaws £98


Hexapod

There are quite a few kits available for building an insect-like Raspberry Pi
robot. While some have four legs, this one from Adeept has six limbs as well
as a self-stabilisation mode, making it capable of creepy-crawling over rough
ground. With a camera mounted on a servo on top and four NeoPixel strips for
lighting, it can also look around and use computer vision to recognise objects
and detect motion. Note that for lower power drain and legacy software
compatibility, it’s advisable to use it with a Raspberry Pi 3B/3B+.

W This bug-like robot can crawl over surfaces and use a camera to look around

Underwater ROV

Exploring the land with a robotic rover is cool, but getting a


submersible ROV (remotely operated vehicle) to dive under the
water is even cooler. We’ve seen a few such Raspberry Pi-based
projects over the years, one of the most impressive being the
underwater drone built by Ievgenii Tkachenko (see magpi.cc/80).
Its four motors, lights, and gyroscope are handled by Raspberry
Pi, which also sends a live video stream. An onshore Wi-Fi router
is connected to the submersible via an Ethernet cable, enabling
remote control from a smartphone. Similar commercial ROVs are
used for boat inspections and to aid rescue operations.

Robot explorers magpi.cc 43


FEATURE

M.A.R.S. Rover Robot


One of the best robot kits around, it lets you explore terrain just
like a NASA Mars rover, and even uses a similar suspension system

Mounted on a mast that can be


rotated, an ultrasonic distance
sensor aids navigation

A rocker-bogie suspension
system enables it to roll
over even large obstacles

The front and rear wheels


feature steering servos for
quicker turning

M.A.R.S. ROVER ROBOT FOR PI ZERO magpi.cc/marsrover £126

44 magpi.cc Robot explorers


FEATURE

W The 4tronix M.A.R.S.


Rover looks very
much like the real
thing and can handle
tough terrain

 t’s amazing to watch in action and


I
far superior to fixed-wheel buggies T A clever rocker-bogie
suspension system
enables M.A.R.S.
Rover to clamber
over large obstacles

N
ot only does this robot look remarkably
similar to the real Mars Curiosity rover,
it uses the same type of rocker-bogie
suspension system developed by NASA. This
allows the six wheels to move up and down semi-
independently so they all maintain contact with
the ground while the rover’s body stays level. It’s
amazing to watch in action and far superior to
fixed-wheel buggies in handling difficult terrain.
It can even clamber over fairly large rocks.
The kit does take a little while to assemble, but
the result is a quality build with metal PCB panels,
six N20 micro gear motors, and chunky wheels.
The finishing touch is a mast with an ultrasonic
distance sensor to the top – it’s mounted on a
servo so you can rotate it. The four corner wheels
have steering servos too, enabling quicker turning.
An optional keypad can be added on the rear for
hands-on route programming.

Real Mars Rover: Curiosity

The 4tronix M.A.R.S. Rover was inspired by NASA’s Curiosity rover,


which – after a journey of 350 million miles – landed on the Red
Planet in 2012 and is still operational today (along with close relative
Perseverance, which arrived in 2021). An ingenious suspension
system for its six wheels helps it to navigate the rocky landscape.
Equipped with an array of scientific instruments, along with a
robotic arm and two cameras, its main mission is to examine the
Martian geology (it can drill into rocks to obtain samples to analyse)
and look for any signs that life could once have existed there.

Robot explorers magpi.cc 45


FEATURE

Robot sensors
Give your robot an awareness of its surroundings
by adding one or more sensors NEXT MON
Start bui
TH!
lding
your rob
ot!

Ultrasonic Temperature & more Gas


magpi.cc/hrso4 £5 magpi.cc/wsbme280 £9 magpi.cc/gassensor £6

Unless it has the more complicated A key metric for analysing your When exploring an unknown
computer vision, the most common robot’s environment is the ambient environment with your rover, you’ll
way a robot can detect large obstacles temperature. Many popular temperature want to sniff out any dangerous gases.
is to use an ultrasonic sensor such sensors can also measure relative The MQ-5 gas sensor can detect LPG,
as the HC-SR04. This works like a humidity and barometric pressure. The natural gas, and coal gas. It has both
form of sonar, and involves emitting a BME280 measures all three and delivers digital and analogue output pins. You
signal and then listening for the echo the data via a digital output to Raspberry could combine it with a flame sensor
to return. The time delay indicates the Pi, so there’s no need to use an ADC to (e.g. magpi.cc/flamesensor) to detect
distance to the object. decode analogue readings. both gas leaks and fires.

Sound Motion Camera


magpi.cc/soundsensor £4 magpi.cc/imu9dof £15 magpi.cc/camera £24

Your robot may have eyes (or at least An IMU can determine a robot’s When controlling your rover remotely,
ultrasonic object detection) to help motion and orientation. Sensors a camera is a vital aid for navigation
it find its way around, but adding come with varying DOF (degrees of and getting a detailed view of its
‘ears’ can aid it in understanding its freedom); a 9DOF one (as here) can environment. Whether you use a
surroundings. This sound sensor has an detect three-axis acceleration, three- Raspberry Pi Camera Module or a
adjustable loudness threshold – when axis gyroscopic motion, and three-axis USB webcam, there’s the option
reached, it switches the digital output to compass heading. While not essential of using computer vision such
high. Alternatively, you could use a USB for a wheeled rover, an IMU is vital for as OpenCV (magpi.cc/opencv) to
mic to record and analyse sounds. a walking robot’s sense of balance. recognise objects automatically.

46 magpi.cc Robot explorers


Your FREE guide to
making a smart TV

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

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

magpi.cc/mediaplayer
TUTORIAL

Using M.2 HAT+


with Raspberry Pi 5
Raspberry Pi M.2 HAT+ M Key enables you to connect M.2 peripherals such
as NVMe drives and other PCIe accessories to Raspberry Pi 5’s PCIe interface

T he M.2 HAT+ adapter board converts


between the PCIe connector on Raspberry
Pi 5 and a single M.2 M key edge
connector. You can connect any device that uses
the 2230 or 2242 form factors. The M.2 HAT+ can


Power and activity LEDs
Conforms to the Raspberry Pi HAT+
specification (magpi.cc/hatplusspec)

Includes:
supply up to 3A of power. • ribbon cable
The M.2 HAT+ uses Raspberry Pi’s HAT+ • 16mm GPIO stacking header
specification, which allows Raspberry Pi OS • 4 threaded spacers
Nate
MAKER

to automatically detect the HAT+ and any • 8 screws


Contino
connected devices. • 1 knurled double-flanged drive attachment
Nate is a The included threaded spacers provide ample screw to secure and support the M.2 peripheral
retrofuturist and room to fit the Raspberry Pi Active Cooler beneath
writes documentation
for Raspberry Pi. an M.2 HAT+. Installation
The M.2 HAT+ is only compatible with the To use the Raspberry Pi M.2 HAT+, you will need a
lambdalatitudi-
narians.org Raspberry Pi Case for Raspberry Pi 5 if you Raspberry Pi 5
remove the lid and the included fan. Each M.2 HAT+ comes with a ribbon cable, GPIO
stacking header, and mounting hardware. Complete
the following instructions to install your M.2 HAT+:
First, ensure your Raspberry Pi runs the latest
E nsure your Raspberry Pi software. Run the following command to update:

runs the latest software sudo apt update && sudo apt upgrade

Next, ensure that your Raspberry Pi firmware


Features is up to date. Run the following command to see
• Single-lane PCIe 2.0 interface (500 MB/s peak what firmware you’re running:
transfer rate)
• Supports devices that use the M.2 M key sudo rpi-eeprom-update
edge connector
• Supports devices with the 2230 or 2242 If you see December 6, 2023 or a later
form factors date, proceed to the next step. If you see a
• Supplies up to 3A to connected M.2 devices date earlier than December 6, 2023, run the

48 magpi.cc Using M.2 HAT+ with Raspberry Pi 5


TUTORIAL

You’ll Need
> Raspberry Pi 5
magpi.cc/
raspberrypi5

> M2 HAT+
magpi.cc/m2hatplus

> NVMe Drive (optional)

An M.2 SSD (or other


device) can be fitted into
Warning!
the M.2 key edge connector
Power
The ribbon cable connects Always disconnect your
the M.2 HAT+ to the PCIe Raspberry Pi from power
before connecting or
connector on Raspberry Pi 5 disconnecting a device
from the M.2 slot to
avoid damaging it.

following command to open the Raspberry Pi


Configuration CLI:

sudo raspi-config

Under Advanced Options > Bootloader Version,


choose Latest. Then, exit raspi-config with
Finish or the ESC key.
Run the following command to update your
firmware to the latest version:

sudo rpi-eeprom-update -a

Then, reboot with sudo reboot.


1. Disconnect the Raspberry Pi from power
before beginning installation.
2. The M.2 HAT+ is compatible with the
Raspberry Pi 5 Active Cooler. If you have
an Active Cooler, install it before installing
the M.2 HAT+.
3. Install the spacers using four of the provided

Using M.2 HAT+ with Raspberry Pi 5 magpi.cc 49


TUTORIAL

4. Set the M.2 HAT+ on top of the spacers, and use

Top Tip screws. Firmly press the GPIO stacking


header on top of the Raspberry Pi GPIO pins;
the four remaining screws to secure it in place.

orientation does not matter as long as all pins


AI Kit fit into place. Disconnect the ribbon cable from
the M.2 HAT+, and insert the other end into the
The M.2 HAT+ also
enables you to PCIe port of your Raspberry Pi. Lift the ribbon
use other devices cable holder from both sides, then insert the
such as the Hailo cable with the copper contact points facing
AI module found
in the Raspberry
inward, towards the USB ports. With the ribbon
Pi AI Kit. cable fully and evenly inserted into the PCIe
magpi.cc/aikit port, push the cable holder down from both
sides to secure the ribbon cable firmly in place.

5. Insert the ribbon cable into the slot on the M.2


HAT+. Lift the ribbon cable holder from both
sides, then insert the cable with the copper
contact points facing up. With the ribbon
cable fully and evenly inserted into the port,
push the cable holder down from both sides
to secure the ribbon cable firmly in place.

50 magpi.cc Using M.2 HAT+ with Raspberry Pi 5


TUTORIAL

6. Remove the drive attachment screw by turning 8. Congratulations, you have successfully
the screw counter-clockwise. Insert your M.2 installed the M.2 HAT+. Connect your
SSD into the M.2 key edge connector, sliding Raspberry Pi to power; Raspberry Pi OS will
the drive into the slot at a slight upward angle. automatically detect the M.2 HAT+. If you use
Do not force the drive into the slot: it should Raspberry Pi Desktop, you should see an icon
slide in gently. representing the drive on your desktop. If you
don’t use a desktop, you can find the drive at
/dev/nvme0n1. To make your drive available for
file access automatically, consider configuring
automatic mounting (magpi.cc/automount).

7. Push the notch on the drive attachment screw


into the slot at the end of your M.2 drive. Push
the drive flat against the M.2 HAT+, and insert
the SSD attachment screw by turning the screw
clockwise until the SSD feels secure. Do not
over-tighten the screw.

Boot from NVMe


To boot from an NVMe drive attached to the M.2 HAT+, complete the
following steps:
1. Format your NVMe drive using Raspberry Pi Imager (magpi.cc/installimager).
You can do this from your Raspberry Pi if you already have an SD card with a
Raspberry Pi OS image.
2. Boot your Raspberry Pi into Raspberry Pi OS using an SD card or USB drive
to alter the boot order in the persistent on-board EEPROM configuration.
3. In a terminal on your Raspberry Pi, run sudo raspi-config to open the
Raspberry Pi Configuration CLI.
4. Under Advanced Options > Boot Order, choose NVMe/USB boot. Then, exit
raspi-config with Finish or the Escape key.
5. Reboot your Raspberry Pi with sudo reboot.

For more information, see NVMe boot (magpi.cc/nvmeboot).

Using M.2 HAT+ with Raspberry Pi 5 magpi.cc 51


TUTORIAL

Time travel
Part 01

experiments
in Python
Create inventive new clocks and calendars
using Python’s built-in datetime module

W e can’t change the direction we hurtle


through time, but we can change how
we look at the journey, and maybe,
even, how we feel about it. We’ll show you how
to use Python’s datetime module to create new
pixels, to match the resolution of the eight-inch
screen, and the surface for the window is called
calendar_surface.

clock and calendar designs that help to improve


your productivity. Using a countdown clock, you can
easily see how much time is left in the working day, 03    Adding words and bar graphs
The calendar has three coloured rows: the
Sean
MAKER

so you can schedule work to fit. A bar graph calendar top one shows the date, the middle one the month,
McManus
shows where you are in the day, month and year, to and the bottom one the year. Each row is 256 pixels
Author of Scratch help you measure your progress toward your goals. high, a third of the window height. The magic is
Programming in that each row is also a bar graph, showing progress
Easy Steps, Mission
Python, and Web through the day, month and year. The draw_bar()
Design in Easy Steps. function is passed the fraction to show (e.g. 0.5),

01    Santa Claus is coming!


Get free chapters at the row number between 0 and 2, the background
Sean’s website.
Listing 1 is the ‘Hello World!’ of countdown and foreground colours for the bar, and the text
sean.co.uk clocks, showing how long it is until Christmas. It to show on it. The colours are in the format (red,
uses the datetime module to make an object called
today that contains the current date and time. It
then creates a similar object for Christmas Day. As
the program shows, you can subtract one datetime
object from another to get the difference between
them. The result is accurate to a fraction of a
second, but you’ll see later how to extract just the
number of days. You could use this code to count
down to a deadline, birthday or holiday.

02    Understanding Pygame’s layout


To draw the calendar (see Listing 2), we’ll
use Pygame, which is installed in Raspberry Pi OS
desktop. Run this code from Thonny. In Pygame,
you create a surface, which is a canvas to draw
on. You can then copy (or ‘blit’) images, shapes
S The countdown clock shows me how long until we finish for
or text onto it. Our window size is 1024 × 768 the day, so we can easily choose the biggest task that will fit

52 magpi.cc Time travel experiments in Python


TUTORIAL

For this type of seven-


segment display, place
a resistor between the
digit pins and Raspberry
Pi to protect the LEDs.

You can independently


control each segment
and decimal point on
this display.

T he magic is that each


row is also a bar graph

green, blue). The Pygame Rect object stores the minute. The day_progress variable calculates
coordinates for the bar as (left, top), (width, height) the minutes elapsed in the day and then divides
and the pygame.draw.rect() function creates a it by the total minutes in a day. To convert the
You’ll Need
filled rectangle. First a bar is drawn full width (the day number into a piece of text (or ‘string’)
> 4-digit 7-segment
background colour). Then a bar is drawn with the for display, we use str(today.day). The month_ display 5461AS
width of the fraction for that row. progress is calculated by dividing the current aliexpress.com or
day number by the number of days in the ebay.co.uk

month. List indexes start at zero but datetime > Breadboard


month numbers start at 1, so we subtract 1 from magpi.cc/bboard

04    Adding the text


The text is written twice (lines 12 to 15),
the month number to use it as an index for the
days_in_month list. Using today.strftime("%B")
> Dupont wires
magpi.cc/
dupontwires
first in silver, and then slightly offset in white, to gets us the month name, as a string, from the
simulate a shadow. Line 11 sets the font and font datetime object. The year_progress adds the
size. If you experiment with Pygame, be aware days in the past months to today’s day number
that you won’t see anything change until you run and divides the total by the days in the year,
pygame.display.update() as shown in line 28. accounting for leap years.

05    Calculating the progress


The draw_calendar() function calculates 06   Going loopy
The final loop (lines 30 to 36) keeps
the fractions. The current date and time are calling draw_calendar() to update the screen at
stored in the today object. We can extract one-minute intervals. If you watch closely, you
parts using today.year, today.hour and today. can see the top bar slowly advance. Our prototype

Time travel experiments in Python magpi.cc 53


TUTORIAL

09    Setting up the pins


We’re using the RPi.GPIO module to
control the GPIO pins on Raspberry Pi. It operates
in two modes, BOARD or BCM. In BOARD, the
pin numbers are the physical positions on
the board. In BCM mode, you use the channel
numbers on the processor. For simplicity and
better compatibility, we’re using BOARD. We
X The seven-segment
set all the pins we’re using to be outputs. The
display has 12 pins, segment_selectors list contains the pin numbers
six on the top and six
on the bottom. Each
that control segments A to G on the display.
pin controls a digit, The digit_selectors list contains the pins that
a segment, or the
decimal point
control the digits from left to right.

used time.sleep(60) to pause for a minute


between each update. In the final program, a for
loop repeats a one-second pause, so it can check 10    Displaying a number
The display tricks your eye. Only
whether you want to close the program. one digit is lit at a time but they change
so fast that you see them all together. The
show_number() function displays a number in
a digit position (from 0 to 3). To choose the

07    Connecting the countdown circuit


The four-digit seven-segment display is
digit you want to light, you set its connected
pin to 0. To set a segment in that digit, you

Top Tip perfect for clocks and can also show most letters
(k, m, q, v, w and x can’t be done). Various types
set its connected pin to 1. The GPIO.output()
function enables you to pass a list of values to
are available. Mine is labelled 5461AS and has 12 a list of pins. In line 23, it’s used to activate
Keep the pins, which you connect to Raspberry Pi’s GPIO the right digit. In line 24, GPIO.output() sends
code simple array. Four of the pins control which digit lights the appropriate number_segments values to the
up. To protect the LEDs, put a 100 ohm resistor pins for the segments. The decimal point is
The calendar’s leap
year calculation is between these pins and your Raspberry Pi. Check turned on for the second digit to separate hours
only accurate until the documentation for connection instructions if from minutes.
the year 2100, but you’re using a different display.
this code is highly
unlikely to be in use
in 76 years’ time. DOWNLOAD
listing1.py THE FULL CODE:
08    Designing the number shapes
Take a look at Listing 3, which runs the magpi.cc/seancode
countdown clock. Each digit on the display has > Language: Python
seven segments, which can be either lit or off. The
segments are ordered in a clockwise direction, 001. import datetime
starting at the top and ending with the middle 002. today = datetime.datetime.now()
bar. They’re usually known by the letters A to 003. xmas = datetime.datetime(
G. The number_segments list contains the on/off year=today.year, month=12, day=25)
settings for the segments in each number. The 004. days_to_xmas = xmas -
first number is zero, so all the segments are lit datetime.datetime.now()
except the middle bar. The last one is nine, so all 005. print(days_to_xmas)
the segments are lit except E.

54 magpi.cc Time travel experiments in Python


TUTORIAL

11    Calculating the time left


Datetime’s timedelta class is ideal for
calculating simple time differences. In lines 31 to
32, we create timedeltas for the end time (17:30)
and the current time. Line 33 works out the
difference between them and formats the result
as a string. We’ve added a 0 at the start so there
are two digits for single-digit hours. If the time W The dark bars on the
progress calendar
difference is negative, the string is set to zeroes. show we’ve passed
You could set different end times depending half-way in May
and have completed
on the day of the week, or have multiple more than a third
countdowns to lunchtime and home time. of the year already

listing2.py DOWNLOAD
THE FULL CODE:
> Language: Python magpi.cc/seancode

001. import pygame, datetime, time 018. days_in_month = [31, 28, 31, 30, 31, 30, 31,
002. from pygame.locals import * 31, 30, 31, 30, 31]
003. pygame.init() 019. today = datetime.datetime.now()
004. calendar_surface = pygame.display.set_ 020. if today.year % 4 == 0:
005. mode((1024, 768)) 021. days_in_month[1] = 29 # leap year
022. day_progress = (((today.hour * 60) +
006. def draw_bar(fraction, row, color, color2, today.minute) / (60*24))
text): 023. draw_bar(day_progress, 0, (204,153,255),
007. box = Rect((0, row * 256), (1024, 256)) (178,102,255), str(today.day))
008. pygame.draw.rect(calendar_surface, color, 024. month_progress = today.day /
box) days_in_month[today.month - 1]
009. box = Rect((0, row * 256), (fraction * 1024, 025. draw_bar(month_progress, 1, (255,153,255),
256)) (255,102,255), today.strftime(“%B”))
010. pygame.draw.rect(calendar_surface, color2, 026. year_progress = (sum(days_in_month[
box) 0:today.month - 1]) + today.day) / sum(
011. font_object = days_in_month) # Split misses last value
pygame.font.Font(‘freesansbold.ttf’, 160) 027. draw_bar(year_progress, 2, (255,153,204),
012. text_surface = font_object.render( (255,102,178), str(today.year))
text, True, (255, 255, 255)) 028. pygame.display.update()
013. shadow_surface = font_object.render( 029.
text, True, (190, 190, 190)) 030. while True:
014. calendar_surface.blit(shadow_surface, ( 031. draw_calendar()
56, 61 + (row * 256))) 032. for seconds in range(60):
015. calendar_surface.blit(text_surface, ( 033. for event in pygame.event.get():
50, 55 + (row * 256))) 034. if event.type == pygame.QUIT:
016. 035. pygame.quit()
017. def draw_calendar(): 036. time.sleep(1)

Time travel experiments in Python magpi.cc 55


TUTORIAL

Top Tip
Everything
but the sync
12    Displaying the time remaining
The for loop starting at line 37 extracts
The calendar the number for each digit from the time_
updates at one-
difference string and calls the show_number
minute intervals, but
it’s not synchronised function to display it. The time_difference
with the clock. string always has a 0 on the front, even if the
Depending on when
hours are 10 or more. That’s why negative
you start it, it might
update mid-way indexes are used to find each digit number,
through each minute. counting from the end of the string. The third
digit we want to display, for example, is at
position -5. Strings are great for extracting
individual numerals from a long number, but
we have to send show_number() an integer,
because it will be used as a list index to find
the segments to light. Line 38 uses int() to
do the conversion. The tiny time delay in line
X The four-digit display 39 ensures you see all the digits at once, and
measures 5cm by
1.8cm and costs a
the while loop keeps updating the time and
few pounds online. refreshing the display.

listing3.py DOWNLOAD
THE FULL CODE:
> Language: Python magpi.cc/seancode

001. import sys, time, datetime 023. GPIO.output(digit_selectors, switches)


002. from datetime import timedelta 024. GPIO.output(segment_selectors,
003. import RPi.GPIO as GPIO number_segments[number])
004. 025. if digit == 1:
005. number_segments = [ 026. GPIO.output(decimal_point, 1) # on
006. [1,1,1,1,1,1,0], [0,1,1,0,0,0,0], 027. else:
007. [1,1,0,1,1,0,1], [1,1,1,1,0,0,1], 028. GPIO.output(decimal_point, 0) # off
008. [0,1,1,0,0,1,1], [1,0,1,1,0,1,1], 029.
009. [1,0,1,1,1,1,1], [1,1,1,0,0,0,0], 030. while True:
010. [1,1,1,1,1,1,1], [1,1,1,1,0,1,1] 031. end_time = timedelta(
011. ] hours = 17, minutes = 30)
012. segment_selectors = [18, 8, 36, 26, 24, 16, 38] 032. now_time = timedelta(hours =
013. digit_selectors = [22, 12, 10, 40] datetime.datetime.now().hour, minutes =
014. decimal_point = 32 datetime.datetime.now().minute)
015. GPIO.setmode(GPIO.BOARD) 033. time_difference = “0” + str(
016. GPIO.setwarnings(False) end_time - now_time)
017. for pin in segment_selectors + digit_selectors + 034. if “-” in str(time_difference):
[decimal_point]: 035. time_difference=”00:00:00”
018. GPIO.setup(pin, GPIO.OUT) 036. time_index = [-8,-7,-5,-4]
019. 037. for digit in [0, 1, 2, 3]:
020. def show_number(digit, number): 038. show_number(digit, int(
021. switches = [1, 1, 1, 1] time_difference[time_index[digit]]))
022. switches[digit] = 0 039. time.sleep(0.005)

56 magpi.cc Time travel experiments in Python


AN INTRODUCTION TO

& GUI
PROGRAMMING
All you need to know
to write simple
programs in C and
start creating GUIs
Inside:
■ Create simple command-line C programs
■ Control flow with conditions and loops
■ Handle variables, strings, and files
■ Design graphical user interface
applications in C
■ Handle user input with buttons and menus
■ Use advanced UI features such as data
stores and dialogs

£10 with FREE


worldwide delivery

Buy online: magpi.cc/cgui


TUTORIAL

Raspberry
cash
Build a working cash register with Raspberry Pi

Dr Andrew Lewis
Dr Andrew Lewis is a
specialist fabricator
and maker, and is the
owner of the Andrew
Lewis Workshop.

Right
Yes, you could always
just wear a trader’s
money belt and
carry a calculator
if you need to, but
a battery-powered
cash register with a
working drawer looks
much nicer. Being
able to take cash and
generate receipts
without a power

T
connection can save
hundreds of pounds
in cash if you’re at a he world of the future is a largely CALCULATOR WITH CONTROL ISSUES
trade show where the
organisers charge for
cashless society, but the world of Cash register and EPOS system are really just
power connections today still uses metal tokens and catch-all terms for a fancy calculator, and it’s worth
paper promises to facilitate defining exactly what we’re going to be building here,
QUICK TIP transactions. In an urban store you’ll and why. A typical modern cash register sits on the
probably find an electronic point of sale counter next to the cashier and it allows the cashier
If you want to
(EPOS) system that handles the shopping to calculate the total value of the items being
delete the last item
scanned, use the experience, but when you’re on a market stall away purchased. In the old days, this was a purely
BACKSPACE key. If from regular power, the conventional EPOS mechanical beast that required the cashier to know
you have text in the experience isn’t as easy to implement. In this article, the price of each item and enter it correctly. As
register’s buffer, it you’ll see how to create a working cash register with technology advanced, barcodes were used to give
will delete the last a secure money drawer, barcode scanner, and receipt each item a unique code that could be read by the
character typed. If
printer. You’ll get it all running from a Raspberry Pi cash register and checked against a database of
the buffer is empty,
it will delete the and DeWalt battery, and you’ll also have a built-in prices, so that the cashier no longer needed to enter
last line item added daily transaction log, and the option to use any the items manually into the register unless the
to the current sale. wireless device as an extra till display. barcode was damaged. In modern times, the cashier

58 magpi.cc Build a working cash register with Raspberry Pi


TUTORIAL

REGISTER INPUT
The cash register application gets input from the
barcode scanner and keypad by monitoring system-
wide key presses using pynput. Key presses from the
touchscreen web interface are generated by passing
an API request from the web page back into the main
app, which generates the appropriate key codes
using pynput. It’s worth noting that the generated key
code may vary between OS and the type of device
that generates them. For example, the decimal point
may generate different codes depending on whether
it’s being sent from the main keyboard, the numeric
keypad, or an external device. You may need to adjust
the code slightly to suit your particular input devices.
The barcode scanner used in this project appears
as a standard input device, and to all intents and
purposes acts like a keyboard. When the user scans YOU’LL NEED
a barcode, the code is translated into a string of
Raspberry Pi 3
characters and ‘typed’ into the computer. To avoid the (or similar – less
need for a database of scannable items, the barcode powerful versions
is encoded as a simple string with a ‘:’ symbol as draw less power)
the delimiter. The first part of the string is an item
description, and the second is the price of the item. So 7” HDMI
touchscreen
a barcode with the string ‘snacks:5.4’ would generate
or a tablet to view
a sale item with the title ‘snacks’ for £5.40 (or whatever the till display
currency you’re working in). The type of barcode isn’t
actually very important: as long as it can encode the Barcode scanner
text you want to enter correctly, the scanner will read amazon.co.uk/dp/
B08CHFN3T2
and decode it as plain text.
DC solid-state
relay
that displays the current transaction in a browser. The amazon.co.uk/dp/
B07PYZZ3G4
browser launches in kiosk mode when the computer
starts. This might seem a strange way to implement Cash drawer, 12 V
the display, given that there are several GUI tools RJ11 connection
amazon.co.uk/dp/
(like Pygame, PyQt, or Tkinter) available for Python, B09ZL3J1M9
but it’s actually a very flexible way to implement the
interface. The web browser can be easily customised M110 thermal
receipt printer
with HTML and CSS to alter its appearance without amazon.co.uk/dp/
needing to change the main Python code, and B0C33JSKTL
additional interface functionality can be added using
Set of laser-cut
JavaScript on the client side. You can also connect case pieces
is sometimes entirely missing from the equation and multiple web browsers to the same cash till and use (or suitable
project container)
the shop makes us do all of the work ourselves, them as remote displays or remote terminals
paying for items by putting money into a slot or for the register. 2 × XL4015 5 A
waving a debit card in front of a scanner. What you For this project, you will be connecting the step-down
will be creating is something like the last generation Raspberry Pi to a basic receipt printer, which adjustable PSU
amazon.co.uk/
of cashier-driven register. Your cash register will have requires between 5 and 9 volts to power it. You gp/product/
a touchscreen interface, a barcode scanner, a remote may have already spotted the immediate B081JP5YZP
keypad, a receipt printer, and the facility to keep daily problem that the Raspberry Pi GPIO header uses DeWalt 5 A
transaction lists that can be read at a later date. This 3.3 V and isn’t 5 V tolerant, although this isn’t battery
register won’t accept debit or credit cards by default, actually a huge issue. The printer only needs
3D-printed
but it should be possible to add that functionality if bidirectional communication to report the status of DeWalt battery
you want it. With a little extra work and a third-party the paper tray (which isn’t really necessary for adapter
API like Square, you could generate transactions that everyday use) and the 3.3 V GPIO voltage of the (or similar,
hsmag.cc/
accept card payments from a contactless reader. Raspberry Pi is high enough to trigger a high input on DWBatteryAdapter)
The cash register application is written in Python, the printer, so it’s possible to connect the printer
and uses a Flask web server to generate a web page directly to the Raspberry Pi without a level shifter, Inline fuse 1 A

Build a working cash register with Raspberry Pi magpi.cc 59


TUTORIAL

provided that you don’t connect to the RX pin


(GPIO 15) on the Raspberry Pi.
You can normally force a receipt printer to produce
a self-test by powering it on with the button pressed.
Although it varies from brand to brand, you’ll normally
see information about the firmware, character sets,
and serial connection settings for the printer. Most
DRAWER TRIGGERS
serial ports will be defaulted to 9600 or 19,200, with
QUICK TIP Cash drawers are normally available in 12 V or 24 V
the usual 8 bits, no parity, and 1 stop bit. varieties. The 24 V version is probably more common
Thermal printers Thermal printers use a control language called on modern EPOS systems, while the 12 V versions
are fussy and are usually found on older-style cash registers. Some
ESC/POS, using escape codes to generate
easy to confuse. new cash drawers are smart and have a processor
If you’re getting character effects. It’s an old technology – and unlike a
built-in with a USB trigger, but in general, most
garbage printed modern desktop printer, a thermal receipt printer has
‘normal’ cash drawers just have an RJ11 socket that
unexpectedly, try very limited capabilities. Printing images is quite connects to the solenoid and to a microswitch that
power-cycling the complicated to achieve, and printed text relies on a triggers when the drawer is open. On these cash
printer to reset it. built-in font with escape codes used to apply simple drawers, you can easily map the pinout of the wires
modifiers like reverse-printing and by measuring the resistance between the pins on the
double‑size characters. There’s also a built-in facility RJ11 socket. The resistance of the solenoid will be
easy to detect with a multimeter, and the continuity
to generate barcodes in most receipt printers.
between the pins connected to the microswitch
Some units also have a special connection that can should also be easy to detect. Opening the drawer
be used to trigger the cash drawer when a receipt is as simple as applying the correct voltage to the
Below is printed. solenoid for a short amount of time (typically less than
Thermal receipt While it’s possible to set up a serial connection to 250 ms). On some of the more complicated drawer
printers are
very simple and the printer and send the escape codes directly, it’s systems, there are two independent cash drawers
communicate using with separate solenoids that share a centre tap. This
an RS-232 or TTL
much easier to use Adafruit’s Thermal Printer library
is sometimes referred to as ‘Epson wiring’ with pins 2
port, although some and Blinka. Blinka allows you to use CircuitPython
of the more modern and 5 connected to the outside (negative) legs of the
units have a USB or APIs in regular Python, and can be installed from solenoids, while pin 4 is the shared (positive) centre
Bluetooth connection circuitpython.org/blinka or using the pip installer. tap. There are several other systems in use, but these
are probably the most common in the modern day.

Finally, you’ll need to install pynput, which is the


module that reads and generates key press events.
You can install pynput straight from the pip package
manager using python -m pip install pynput.
One thing to watch out for with thermal printers is
that they are relatively slow and don’t really
communicate bidirectionally with the device they’re
connected to. This means that there’s no signal to
say when the printer is ready to print, or when the
printer is already printing. It’s quite possible to send
data to the printer so quickly that the internal buffer
becomes overwhelmed and it starts missing
characters. You need to make sure that the program
you’re using won’t send the data to the printer faster
than it can output onto the till roll.
Begin making your own cash register by installing
the latest version of Raspberry Pi OS onto a
Raspberry Pi 3, or later model, and making sure that
all of the packages are up to date. Once you’re
ready, go into the Preferences menu on the desktop
and bring up the Raspberry Pi Configuration
application. Check that the serial port is enabled,

60 magpi.cc Build a working cash register with Raspberry Pi


TUTORIAL

KIOSK MODE
and serial console is disabled, accept any changes,
You’ll probably want to automatically run the keys.py file and start a kiosk mode
and reboot the machine.
web browser when the computer starts up. To do this, you need to install some
Next, you’ll need to install some Python libraries packages that will help you control the window manager, and edit the autostart file in
that the cash register application depends on to /home/user/.config/lxsession/LXDE-pi.
get your code working. You’ll need the Blinka Begin by installing the packages:
library and the Adafruit Thermal Printer library, sudo apt-get install x11-xserver-utils unclutter
which you can install by following the instructions at Edit the autostart file using nano:
sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
hsmag.cc/AdafruitReceiptPrinter. Next, you’ll
Add the following lines to the autostart file:
need to install the Flask framework, which you will @python /home/user/Desktop/till/keys.py
be using to create a Python-based web server. @chromium-browser --kiosk --incognito --disable-pinch --overscroll-
Follow the instructions found at hsmag.cc/Flask to history-navigation=0 http://127.0.0.1:5000
do this. Then, install the cash register files into a @xset s noblank
folder called till on the desktop (or in the location of @xset s off
@xset -dpms
your choice). The main application in the folder
@unclutter -idle 0.1 -roo
is keys.py.
Save the file and exit nano. This autostart configuration will cause the Raspberry Pi to
Next, you need to wire up all of your electronic boot into a kiosk mode, disable the screensaver, and hide the mouse. It’ll also mean your
components to the Raspberry Pi’s GPIO pins. You’ll desktop will be completely blank. If you want to be able to access the desktop, you’ll
be drawing power from an 18 V battery, and dropping need to edit the autostart again to include the following lines at the top of the file:
to 5 V and 12 V using buck converters. The 12 V buck @lxpanel --profile LXDE-pi
converter is used to open the cash drawer, and can

QUICK TIP
The more powerful
the Raspberry Pi,
the more battery
power it will need
to run. A Raspberry
Pi 3 will be fine for
this project.

Left
You can see from
this diagram that
the wiring for the
cash register is not
complicated, but
there are a couple
of things that you
should watch out for.
Firstly, this diagram
doesn’t show
the USB or HDMI
connections for a
touchscreen or other
peripherals. When
you are mounting
your Raspberry Pi
inside your case, be
sure to allow enough
space for cables to
plug in. You should
also apply the same
thinking to make
sure that you can get
batteries in and out
easily. Remember
that any digital cable
is susceptible to
interference, so keep
the cables to your
external components
as short as possible

Build a working cash register with Raspberry Pi magpi.cc 61


TUTORIAL

be omitted if you have a 24 V cash drawer. If you thermal printers to print out their input voltage
have a 12 V drawer and want to risk omitting the buck during a self-test. This isn’t very accurate, so don’t
Above
The inside of the case converter anyway, the risk and responsibility are your be too worried if the reported voltage is slightly
should be neat and own to consider. It may work fine, or it may burn out under 5 volts. The thermal printer is also a power
tidy, properly fused,
and inaccessible to the drawer solenoid after a while. hog, and can draw up to 10 W while printing. The
the general public.
Lots of venues will
The 12 V power is controlled by a solid-state relay Raspberry Pi itself (and USB peripherals) will only
ask you to create a connected to GPIO 17, and should only trigger for a be drawing a couple of watts, but if you are using a
risk assessment for
your stall, and prove few milliseconds at a time, which would probably touchscreen display, it can add another 4 or 5 watts
that your equipment is prevent the solenoid from damage, but that isn’t to overall consumption depending on how it’s
safe. Exposed wires or
pins (even low voltage guaranteed safe to use. The other 5 V configured. If you’re planning on a long workday,
ones) don’t look good buck converter is used to power the Raspberry Pi consider taking along extra batteries just in case
to an event organiser or
health and safety officer and the thermal printer. It’s not unusual for you start running short.

62 magpi.cc Build a working cash register with Raspberry Pi


TUTORIAL

This tutorial is from


HackSpace magazine.
Each issue includes a
huge variety of maker
projects inside and
outside of the sphere
of Raspberry Pi, and
also has amazing
tutorials. Find out
more at hsmag.cc

Below
This project is likely
to get bounced
around a bit when
you’re setting up and
disassembling your
store. Make sure that
your case is sturdy
enough to deal with
that by gluing your
joints well

Left
There’s plenty
of spare pins for
expansion of the
cash register, so
adding NFC readers,
servos, or custom
button boards is
absolutely possible

There are a few extra things that you could


consider adding to this project if they suit your needs,
including adding an NFC reader to read staff cards so
that you can record who took a sale, or adding extra
‘hidden’ web pages to make downloading daily
transaction records easier. You could also add a
second battery connector to double the battery life
and make it possible to swap batteries without
restarting the till. You could also implement a local
database of items with prices, so you can set the
prices at the till rather than on the barcode itself.

Build a working cash register with Raspberry Pi magpi.cc 63


FEATURE

Raspberry Pi
SUCCESS
STORIES
As well as lending itself to innumerable creative projects,
Raspberry Pi has a trusted role at the heart of many products.
By Rosie Hattersley

T
he relatively low cost of Raspberry Pi has researchers and start-up businesses make regular
always been one of its prized features, use of Raspberry Pi alongside its industrial
lowering the cost of entry to technology cousin, Compute Module; prizing its robust
and computing in an attempt to make the hardware, Linux base, passionate user community
discipline more accessible. and, yes, relatively low cost, when designing and
Since 2012 Raspberry Pi has been “on a mission building putative products for commercial release.
to put high-performance, low-cost, general- Raspberry Pi is rightly proud of the hundreds
purpose computing platforms in the hands of of ways its passion–project has been adopted
enthusiasts and engineers all over the world”. by home users, educationalists and industry.
Global sales of Raspberry Pi over the 12 years of Money from industrial sales is ploughed back
its existence have topped 60 million, with users into the Raspberry Pi Foundation to fund ongoing
in almost every country. The MagPi has reported computing education projects while buying
on Raspberry Pi projects from New Zealand to the products badged ‘Powered by Raspberry Pi’ has
Arctic, Hawaii to Nepal with many instances of become a hallmark of quality and reliability.
remote classrooms, distant wildlife monitoring, Here are some of the practical and prosaic ways
citizen stargazing, telemedicine, antigen testing, Raspberry Pi has been making a difference.
and diverting forms of entertainment regularly Maybe one day your passion project will become a
filling our pages. Medical institutions, university success story!

64 magpi.cc Raspberry Pi Success Stories


FEATURE

ENTERTAINMENT
Korg synthesisers
magpi.cc/korg

Korg is an iconic Japanese synthesiser brand that came to prominence in the 1970s and
1980s having launched drum machines in the 1960s. Expanding into both professional and
hobbyist synthesiser markets it was a very early adopter of DSPs (digital signal processors)
– specialised chips that enable real-world analogue audio to be rapidly manipulated in
digitised form. Success soon equalled demand for ever more complex processing along
with support for polyphonic voices, leading Korg to launch pricier models in part because
it used custom ASIC (application-specific integrated circuits) designs. To break free from
the constraints of ASIC designs, Korg’s California-based Korg R&D team has focused on
producing affordable DSP synthesisers without compromising on features. Their goal was
to make products accessible to many more musicians, by reaching the sub-$1000 price
point. Korg made the switch to Raspberry Pi’s Compute Module 3 to get
all of what it needed, for a lot less.
“It’s smaller, cheaper, faster, lighter, and better” says product
development manager Dan Phillips. The main panel board contains
all of the user interface elements, including display, buttons,
knobs, wheels, and other synth-specific controls, along with
MCU microprocessors to support them and communicate with
the CM3. Development took only a year, with the “very well-
received” wavestate modwave synth launching in 2020. The
CM3 is “very powerful, which makes it possible to create
deep, compelling instruments.”

Homey Pro smart hub


magpi.cc/homeypro

Making homes ‘smarter’ using IoT (internet of things) connected devices is a fabulous
use of Raspberry Pi: connect your device via a web-based service and use a dashboard
Read more or app to remotely control or schedule lights, heating, curtains, music, washing
on page

34
machines, fridges and more. Trouble is, you can quickly end up needing multiple
apps, hubs and remote controls, since compatibility isn’t a given.
Homey Pro combines everything into a single,
local network-controlled hub that is largely
brand-agnostic. The Compute Module 4 smart
hub works with almost every IoT device, supports
Zigbee, Z-Wave, Wi-Fi, Bluetooth, 433MHz
RF, infrared and Thread, and is “packed with
modules and antennas to support a wide range
of communications protocols,” explain its Dutch
makers Emile Nijssen and Stefan Witkamp.
They were keen to strike a balance between
user-friendliness and polished design, without
sacrificing usability; this user-adaptable ‘best of
both worlds’ approach in which users can create
and share code-free Flow home automation
setups has paid dividends in terms of attracting
customers. Compute Module being Linux-based
works well for the Homey team, as they didn’t
need to reinvent the wheel, allowing them to focus
specifically on excellent smart home functionality.

Raspberry Pi Success Stories magpi.cc 65


FEATURE

iPourIt
magpi.cc/ipourit

Queuing at the bar trying to catch the quickly swapped out behind the scenes and
server’s eye is rarely the most edifying a greater range of beers offered. Customers
experience. Indeed, lengthy waits for have to pass an ID check that verifies their
food and drink service partly inspired the age, saving the business another headache,
concept of iPourIt, in which customers while the streamlined self-serve beer
instead buy an RFID smart key to distribution system also saves on waste.
open a bar tab and then walk up to the Bars can optionally offer a taster before the
selection of drinks and serve themselves. customer buys a full or half pint.
The idea encourages beer drinkers The iPourIt concept began in 2011 as an
(craft beer aficionados are the typical Android tablet-based business, but they
demographic) to drink new products as were expensive to maintain and could not
well as democratising and streamlining be reliably fixed or upgraded remotely. A
the purchasing process. 2019 switch to Raspberry Pi solved both
It also has a novelty factor and proved issues, with Power over Ethernet support
a selling point for pubs and restaurants adding remote control and troubleshooting
keen to attract punters into venues. to the compelling concept. Components
Hospitality venues that buy into iPourIt can be easily switched out. This Raspberry
have a space-saving bar wall installed Pi auto-pourer also undercuts rivals by
while the smarts are handled by either roughly 20%. The concept is accurate to
Raspberry Pi 4 and Compute Module 3. A a millilitre, and its reliability impressed
single CM3 for each beer line controller iPourIt sufficiently that it introduced a
serves 12 taps, precisely measuring each liquor self-service model five years ago.
pour, while Raspberry Pi 4 powers the There are now several thousand iPourIt
touchscreen menu. The idea works well for walls in the US, and a growing number in
beer festivals in which single kegs can be the UK. Thirsty yet?

INDUSTRIAL
AUTOMATION
Sfera Labs
magpi.cc/sfera

When buying technology for personal use – a tablet, router, laptop or screen – you probably expect to use
it for a few years and then either upgrade or get something newer or different. For industry customers,
long-term availability and knowing a key component won’t be discontinued is fundamental. “Nobody is
going to invest in an application if they are not 100% sure that in five years they will be able to use the
application,” Sfera COO Maria Chizzali notes. Her company, Italy’s Sfera Labs, designs and manufactures
critical automation hardware, sensors and controllers for the
energy industry as well as server companies, data centres and
factories. Sfera Labs’ hardware-independent Strato Pi products –
DIN rails, power supplies, hardware enclosures, controllers and
sensors and RAID arrays – all work seamlessly with Raspberry Pi
Compute Module and are top-quality components that don’t tie
customers to a specific company because of the software. Sfera
also makes a range of Iono IoT controllers and sensors aimed at
micro-businesses, such as boutique hotels that need to manage
heating, lighting, and ventilation, and to control guest access. These
user-friendly Bluetooth devices also use CM4, which was chosen as
the ideal device for fast prototyping, value and resilience, as well as
Raspberry Pi’s guarantee to business customers of ongoing support.

66 magpi.cc Raspberry Pi Success Stories


FEATURE

Revolution Pi [aka Kunbus]


magpi.cc/revolutionpi

Given the undoubted success of Compute Module, Pi had already sold seven million units and was
the industrial version of Raspberry Pi, it may seem known and embraced by developers. IoT devices
odd to suggest that such uses were not part of needed some form of ‘glue’ to work with hardware
initial plans. Accessible, modular, user-configurable across brands and industry sectors, and consumer
hardware also seems a natural fit for developers. electronics firms were all about proprietary hardware
German company Kunbus GmBH recognised this and software. “There was a culture clash. The
potential as early as 2016. Industrial controllers (as Internet of Things made PCs and controllers need to
industrial computers were termed) were prized for get along and Raspberry Pi was common ground,”
their reliability but were a largely unknown quantity says Kunbus founder Boris Crismancich.“The
outside their specific use cases, whereas Raspberry company’s commitment to sharing code and
schematics wherever possible, together with the
adaptability of the platform – pretty much anything
open source was compatible with Raspberry Pi by
design – made it unique.
Kunbus set about developing what was to become
Revolution Pi, the first ever industrial Raspberry
Pi controller model featuring the more robust
specifications OEMs needed, including open-source
modular design, support for a 24V power supply, DIN
rail mounting, I/O expansion modules, and optional
Ethernet, alongside a custom operating system. In
an unheard of 10 months, with valuable input from
the Raspberry Pi community, Kunbus developed
and launched Revolution Pi to great success. When
Raspberry Pi launched its own industrial model,
Compute Module 1, two months later, its hunch was
fully validated.

Brompton Bikes
magpi.cc/brompton

To illustrate just how Raspberry Pi automation is used to good effect, Brompton


Bikes invited us along to its London premises to see how it makes use of more
than 100 Raspberry Pi computers. They scan each fold-up bike’s serial number
to track its progress through the factory, control laser-etching machines that
automatically produce the correct plate design
for the type of bike under assembly, monitor the
building’s air quality and temperature, and give
bike-specific instruments to staff at each production
station. Brompton has been using Raspberry Pi
since 2013 (beginning with a handful of Raspberry
Pi 1Bs, the firm now uses a range of models) and
has the philosophy that “if we need to capture data
anywhere on the factory floor, we throw a Raspberry
Pi at it,” says senior software engineer Kane Tracey.
Brompton now sells more than 100,000 commuter
bikes a year, and the company’s use of Raspberry
Pi has expanded exponentially as the range and
production quantities have increased. Nonetheless,
CEO Will Butler-Adams says the Raspberry Pi-based
site is slicker than any other he has seen.

Raspberry Pi Success Stories magpi.cc 67


FEATURE

GLOBAL
IMPACT Freight Farms
magpi.cc/freightfarms

Container farming offers a way to improve food security, and is ideal for
locations with insufficient space, water or nutrients in the soil to raise crops
in fields. The hydroponic approach of companies such as Freight Farms, which
supplies university campuses, remote island communities that lack natural
resources, and food banks with fresh leafy vegetables and herbs, is to increase
“local food access and create a replicable model and a product that could be
used to grow food anywhere, all across the world”. Freight Farms was founded
by two Massachusetts Institute of Design graduates who wanted to set up roof
gardens in inner-city Boston. For their Leafy Green
Machine they fitted out old shipping containers
as climate-controlled environments split into a
seeding area and a main growth area with plants
growing vertically. Raspberry Pi sensors would
monitor pH levels, nutrients, light, temperature,
air and soil moisture, while cameras checked on
plant growth. Highly efficient LEDs and filters to
clean and recycle water kept energy costs relatively
low, with the result that a single container could
produce up to four tonnes of food annually.
Raspberry Pi 4 hardware made controlling each
Leafy Green Machine practicable remotely using IoT
components and a web-based dashboard, while a
switch to a wider angle of view, user-configurable
Raspberry Pi Camera Module made this, and a
switch to app-based monitoring, feasible, with
notable improvements to each site’s efficiency
and food yield. “The cameras take us to that next
level of the farm being foolproof, says supply chain
manager Meaghan Holmes, “while the app helps
the crop grower to notice problems promptly”.

Remote learning needed to be low-cost and work straight out


magpi.cc/sarawakmalaysia of the box. Reseller Cytron was enlisted to
produce a bespoke version of Raspberry Pi OS
Digital exclusion is a concern in places that to run from SD cards on the 9400 Raspberry Pi
have turned away from people-based means of 4 computers which were supplied as kits, each
communication to the detriment of those who with a screen, mouse, keyboard, case, power
can’t or have never learned to use computers supply and HDMI cable.
or who don’t have access to one. In Sarawak,
Malaysia’s largest province, the government was In addition, Raspberry Pi computers were set up
keen to ensure its primary school pupils had as internet-in-a-box offline servers that would
ready access to digital learning opportunities allow educational content to be preloaded
and to ensure access to a consistently high and accessed by rural schools that don’t have
standard of facilities and teaching. reliable access to the internet. Cytron tested
each computer before shipping it to the schools
However, many of Sarawak’s schools lacked along with a classroom-focused learning
basic computer facilities, particularly in rural programme while established education
areas. The education department wanted to partners created a computing curriculum to
provide access to ICT skills and opportunities train at least one teacher in every school to
for coding and electronics-based learning help pupils get the most out of using their
across the region’s 1,265 primary schools. It Raspberry Pi systems.

68 magpi.cc Raspberry Pi Success Stories


FEATURE

Directed Machines
magpi.cc/directedmachines

Crop farming is becoming increasingly mechanised, partly to


extract greater yields from each acre to keep up with the global
demand for food, and partly to keep costs low given the might
of supermarkets for which competitiveness is an unshakable
mantra. Reducing pesticide and fertiliser use is crucial to soil
health, which means smarter ways of raising crops are big
business. Directed Machines’ Land Care Robots are ideal for
agriculture, as well as fruit growing and harvesting, but came
about because CEO George Chrysanthakopoulos needed an the ground to planting seeds, weeding, transplanting seedlings
effective means of clearing heavy falls of snow from his property and harvesting crops. The robot needed to be repairable by the
each year. Neighbours with small farms convinced him of myriad farmers themselves, a crucial aspect of modern-day agriculture.
possible uses for robots in agriculture, and there was a healthy Readily available parts and fairly simple but robust hardware were
market for low-cost mechanised assistants that could help solve therefore imperative, along with accurate performance. Raspberry
some of their pesticide and plant management issues. George’s Pi 4, RP2040 and an AdafruitIMU to guide the Land Care robot
background in robotics at VMWare and Microsoft led him to proved an excellent combination. “The cost/benefit ratio of
develop an autonomous, heavy-duty but relatively cost-effective using the Raspberry Pi ecosystem,” says Dan Abramson, Directed
laser-guided robot that could perform tasks from preparing Machines’ COO and co-founder, “is second to none”.

CLEVER
CAMERAS
Raspberry Shake
magpi.cc/raspberryshake

Earth tremors, volcanoes, violent storms, significant


soundwaves and vibrations from rock or glacier falls can all be
detected and are logged by the aptly named Raspberry Shake.
Even human actions such as traffic jams or large concert crowds
show up on the highly sensitive seismograph, which began as
a volcano monitoring tool for geophysicists but soon became
popular in citizen science projects after its makers recognised crowdsourced data, detecting and recording earthquakes from
the potential of building Shake around Raspberry Pi just as home using a professional-grade seismograph. With Raspberry
sales of our favourite single board computer went stratospheric. Pi already selling in the millions, and a tried and trusted
Having tried other hardware, but found costs prohibitive “we platform, it was both a safe business bet and had a ready-made
built one of our first independently sourced and designed customer base of hobbyist computer scientists keen to tap into
seismographs based on Raspberry Pi 2B,” explains Raspberry globalised Earth-watching.
Shake founder Branden Christensen. The marriage worked well Raspberry Shake is even being used for glacier modelling with
since Raspberry Pi “was relatively inexpensive for what it could University of Leeds researchers using its vibration-based sensors
do,” while “in terms of the design and operation of the [seismo] alongside Raspberry Pi HQ cameras to predict imminent shelf
graph, the technical requirements of the CPU, RAM and hard calving in South America and the Himalayas, providing evidence
disk space were minimal”. A Kickstarter campaign exceeded of accelerating global warming but also giving nearby residents
their target by a factor of 14 and attracted hundreds of backers, potentially life-saving early warnings that such an event is
most of whom were citizen scientists keen to contribute to imminent and they need to evacuate: (magpi.cc/leedsresearch).

Raspberry Pi Success Stories magpi.cc 69


FEATURE

Velo AI
magpi.cc/veloai

It’s no secret that cyclists and motorists don’t always share road space harmoniously.
Velo AI is on “a core mission to improve safety for all forms of mobility through the
use of smart technology,” using Compute Module 4 and a camera to detect approaching
vehicles. These, plus an M.2 Hailo generative AI accelerator board, work out what sort
and size of vehicle is nearby – a small car being less problematic than a lorry or bus
– and determine whether they are coming close enough and travelling fast
enough to distract or endanger the cyclist. The device, known as CoPilot (not
related to either the sat-nav company or Microsoft AI tool of the same name),
attaches to the bike frame beneath the saddle and has a fixed-lens camera
to monitor approaching traffic. Broadly speaking, CoPilot provides the rider
with situational awareness. Moving objects are categorised as ‘following’ but
not coming closer; ‘approaching’ or, the most likely to be dangerous due to
closer proximity, ‘overtaking’. Should a hazard be detected, CoPilot sets off
lights and sounds the alarm to help prevent dangerous situations and crashes.
A handlebar-mounted smartphone can also show current traffic and the road
layout on a Velo AI app.
Low power consumption isn’t a given for processor-intensive AI tasks, and
other boards were rejected largely because they used so much juice. Velo AI’s
robotics expert Clarke Haynes says: “The mere fact Compute Module 4 is a
separate discrete component that just works; we can use everything that’s on
it, including the Wi-Fi and Bluetooth.” CoPilot draws only four to five Watts,
resulting in up to five hours battery life between charges.

SMART
STUFF
Medical marvel critical heart treatment to be stored and
magpi.cc/ekoracardiology efficiently retrieved. The Zero W’s lovely
compact and low-power solution that includes
Medical monitoring equipment doesn’t come USB OTG functionality was “spot-on for our
cheap, but knowing who needs to have their requirements,” while the level of support
organ health checked in the first place is another available from the community and running
tricky aspect of managing a modern health on such a well-designed OS as Raspberry
service. Cardiologists Dr Alan Robertson and Dr Pi OS Lite “made all the difference during
Dougie Elder decided to tackle the thorny issue development,” he says.
of managing patients’ records (often kept on
paper in filing cabinets) and how to efficiently Having proved the concept worked, he set
transfer data from machine to database. Securely about designing a case for it in KiCAD and
downloading pacemaker information from a has since helped with the rollout of EKORA
patient to electronic records and ascertaining across neighbouring healthcare trusts in
priority cases turned out to be a matter of Scotland and beyond. “Some people get
initiating a USB thumb drive download without a defibrillator fitted because their heart’s
the incumbent access risks that means NHS response at times needs a strong electric
hospital networks block such devices. shock to get them back to a normal rhythm.
That episode is the kind where you want to
Alan realised emulating USB On-The-Go on store what happened because it will actually
Raspberry Pi would mean it could be used show the heart rhythm during the episode and
in a similar way to a flash drive, and enable whether the treatment was appropriate.”

70 magpi.cc Raspberry Pi Success Stories


FEATURE

CubeSats
magpi.cc/space

CubeSats are tiny but important self-erecting as the many experts who helped Raspberry Pi
space modules that can be used for research launch Astro Pi, which accompanied British
purposes and lend themselves very well to being astronaut Tim Peake aboard the ISS, readily
launched into the atmosphere with satellites attest (magpi.cc/astropiyt). The UK Space
(hence their name) and being stowed away on and European Space Agency project involved
spacecraft such as the ISS (International Space schoolchildren developing investigative citizen
Station). Anything that is to go into space science investigations that are then deployed by
undergoes rigorous testing and certification, ISS astronauts and results sent back to Earth,
underpinning rigorous scientist learning and
promoting STEM careers. Raspberry Pi has been
accumulating a solid flight heritage since Astro
Pi’s debut space mission in 2015. Hardware used
in Raspberry Pi-based in CubeSats are space-
hardened versions of the industrial board which is
popular for rapid prototyping. CubeSat designers
can build a flatsat using the same tooling they
use in orbit, and move to industrialised versions
of the hardware once they are flight-ready.
Examples include the GASPACS (Get Away Special)
CubeSat designed and launched by Utah State
University students which was based around the
tiny, lightweight Raspberry Pi Pico. The NASA-
backed GASPAC spent 117 days in space in 2022
testing passive attitude stabilisation on a metre-
long satellite balloon, correcting its trajectory and
demonstrating enhanced control options.

 he NASA-backed GASPAC
T
spent 117 days in space in 2022

Blue Robotics Blue Rov 2


magpi.cc/bluerov2r4

Blue Robotics’ range of modular underwater drone kits and parts is one of
the very coolest commercial uses of Raspberry Pi that we’ve encountered.
With a back story involving a personal challenge to autonomously power
a surfboard from the US West Coast to Hawaii, the submersible Blue Rov
(short for remotely operated vehicle) can capture
1080p video footage and has an on-board
gyroscope, accelerometer and magnetometer as
well as pressure, depth, temperature, voltage
and leak detection sensors. A Raspberry Pi 4
capped with a Navigator Flight Controller runs
Blue Robotics’ own BlueOS and adroitly handles
processing and computing duties. Impressively,
it can be used to depths of 100m, while a
premium model can operate 300m beneath the
waves. Withstanding such pressures and depths
makes Blue Rov far more than a hobbyist device:
emergency services’ search and rescue crews have
made invaluable use of them.

Raspberry Pi Success Stories magpi.cc 71


REVIEW

PiDP-10
Oscar Vermeulen / CEDS magpi.cc/pidp10buy From £296 / $370

SPECS
Oscar Vermeulen is back with his most ambitious
ASSEMBLY retro kit yet. PJ Evans returns to the space age
TIME
Approx six hours

DIMENSIONS
Approx 56w
x 16h x 13d

POWER
Via Raspberry Pi

INTERFACES
HDMI, SSH,
RS232

OPERATING
SYSTEMS
EMULATED
TOPS-10, ITS

S The completed using is 56 cm wide as is an accurate 2/3rd


scale reproduction of the original

F ollowing on from his original PiDP-8 kit


and the beautiful PiDP-11 Oscar Vermeulen
now presents his latest DEC computer
recreation: The PiDP-10. Despite the plaudits
for his first two kits, Oscar has not rested on his
laurels and this new offering is a bit special, not
only for the history behind it, but also the sheer
ambition of the recreation.
The original PDP-10, of which this is a two-
thirds scale reproduction, found a place in the
legend and folklore of early computing, mainly
to the MIT AI lab, who’s residents found the
computer to be perfect for hacking about and
creating things, amongst which was the first
computer game, SpaceWar!
These are probably the largest PCBs you’ll
ever work on at home at around 50 cm long.
X There are over 200
components that
They will eventually find themselves in a two-
make up the kit. piece injection-molded case with a meticulously
Patience is rewarded
with nearly aligned
recreated lamp panel. The result is 2001-esque. It’ll
lamps and switches be the best-looking computer in your collection.

72 magpi.cc PiDP-10
REVIEW

Assembly
Assembling the kit is not for the impatient. It took
your reviewer a total of about six hours over two
days. What really made the assembly a pleasure is
the solid online documentation, with lots of hints
and tips, and a superbly notated PCB, ensuring the
builder knows orientation of components at every
step. Oscar has been generous with spares and even
provided parts for mounting optional ‘hacks’.
There are a lot of components to assemble,
including over 120 LEDs and 74 switches. The kit
is well within the capabilities of anyone who is
confident with a soldering iron and there is no
SMD soldering to worry about. Patience is a virtue
here, and will be rewarded with neatly aligned
LEDs and switch banks. Oscar has some great
tips along the way to help you achieve a perfectly
aligned lamp array.
To run everything Raspberry Pi 5 is recommended, It’ll be the best-looking
mounted on the rear of the main PCB, but depending
on what you want to do, you can go all the way
computer in your collection S Once completed,
the builder is
down to a Zero 2 W. The kit comes with a number of rewarded with an
impressive light show
optional hardware improvements, including cutouts A nice touch is the teleprinter software included
and mounting points for RS232 adaptors and large (you’ll need to use HDMI for this). You can also use
cooling fans for an authentic sound. SSH or even hook up an original terminal or teleprint
via the optional RS232 interface. Care has been taken
Software to ensure the main OS is not tampered with, so you
Once built, generous instructions for its use are can ‘double duty’ your Raspberry Pi if you wish.
provided. Software installation is straightforward, The price may make you wince but this still
running on top of an existing Raspberry Pi OS install. represents good value for money. The time, care
You have the option of running DEC’s own TOPS-10 and effort put into the kit design, its instructions
OS or the more fun ITS from MIT. Documentation and provided software truly impressed us. Fun to
and lots of software make this a great tool for build and rewarding to explore. A must for any
exploring computer history. retro computer enthusiast.

Verdict
A near-perfect
execution of
preserving
computer history in
a fun and creative
way. Patience and
a steady hand
will reward you
with an amazing
experience and a
beautiful object.

S The rear of the kit shows the


well-ventilated Raspberry Pi
and the optional fans 10 /10
PiDP-10 magpi.cc 73
REVIEW

CrowPi Compact
Raspberry Pi
Educational Kit
Elecrow magpi.cc/crowpi £165 / $208
SPECS

FEATURES:
An educational electronics kit that looks smart
• Nine-inch and bristles with fun stuff. By Ian Evenden
touchscreen
• LCD module
• Camera
• LED segment
display
• vibration motor
• buzzer
• sound sensor
• PIR
• servo interface
• UART
• temperature
sensor
• GPIO
• more
CONNECTIONS:
• USB-C
• USB-A S The board is nicely laid out, and the components aren’t
cramped together
• HDMI to

U
connect to
Raspberry Pi sing Raspberry Pi as a platform to microSD card, USB lead, and power/video cable
4B or 5 experiment with electronics is excellent first) and you’ve instantly created a small
DIMENSIONS: fun. However, sometimes it can be messy, electronics lab. Downloadable lessons are available
270mm × and it takes time to amass the bits and pieces for Scratch, Python and Minecraft, or you can go
170mm × 80mm needed. Enter the CrowPi Compact Raspberry Pi your own way.
Educational Kit, a board in a box to which you add
your own Raspberry Pi. Box of delights
The board itself comes in a sturdy case with Elsewhere on the board you’ll find a USB-C power
a handle, looking very much like we assume input, speakers, an LED display, GPIO pins, an
espionage equipment looks, and in this upgraded RFID chip, plenty of sensors and switches and
version there’s a nine-inch touchscreen in LEDs, and more besides. In the box there’s also a
the lid. Screw your Raspberry Pi 5 (or 4B) to startling array of extra components, including a
the mainboard (remembering to plug in the pair of SNES-like gamepads, a US-style power plug

74 magpi.cc CrowPi
REVIEW

W The IPS touchscreen


in the lid has
a resolution
of 1024×600px
T When closed, you’d
never guess what
lurks inside the
smart hard case

(with a three-pin adapter for UK sockets), servo


and stepper motors, an IR remote, LEDs, a small
stylus, headphones (3.5mm, so there’s nowhere
to plug them in on a Raspberry Pi 5 board) and
more. A GPIO ribbon cable is meant to bridge the
gap between the Raspberry Pi’s pins and those on
the carrier, but one wasn’t included in the package
sent to us for review. Something that will fit is
pretty cheap and easy to get online, but it would
have been nice to have had it included.
It takes a bit of force to successfully mate your A screw loose
Raspberry Pi 5 board with the CrowPi carrier, as A version of the Raspberry Pi OS with appropriate
the cables put up some resistance to getting it in drivers is available from the CrowPi website - a
3.9GB download - and while the board booted
first time, it threw an error when we tried to use
In the box there’s the Recommended Software tool and the Terminal
(the Terminal text is tricky to read on such a small
also a startling array
of components
screen, but that’s not Elecrow’s fault) to install
new programs. There was also a loose screw in Verdict
the case, which fell out when we tried giving it
This CrowPi kit has
an experimental shake. a lot of potential
exactly the right place, and once it’s screwed down These problems are ones that can be fixed via as an educational
the microSD slot is inaccessible. You might also software patches or by updating the package tool, and we hope
the problems
need to rely on Wi-Fi for networking, as the USB contents for future orders, and don’t affect
we encountered
cable goes across the Ethernet port, though you the fact this is a convenient and well-made are easily solved
may be able to negotiate a fit with a slim cable. electronics board with prolific features. What teething troubles.

7
Having a power connection enter vertically at the they do mean is that, in its current state, it’s
top right of the motherboard feels clunky too - it slightly difficult to recommend the CrowPi

/10
would have been so much tidier to have it pierce Compact Raspberry Pi Educational Kit, which
the casing at the rear. is a shame, as it could be brilliant.

CrowPi magpi.cc 75
REVIEW

ED-IPC3020
EDATEC magpi.cc/ipc3020 From £113 / $140 (ex. VAT)

SPECS
An industrial PC based around Raspberry Pi 5. By Phil King
FEATURES
Metal case,
heatsink base
and cover, RS-
232 and RS485
ports, audio in
and out, M.2 M
Key connector,
RTC CR1220
battery holder,
5V out, speaker
connector,
buzzer
S Removing the case top reveals Raspberry Pi 5 connected to
RAM a motherboard with some extra ports

4GB or 8GB W The metal case, with a large ridged heatsink, includes extra
ports for RS-232/RS-485 and audio in/out
(Raspberry Pi 5)

STORAGE
(SUPPLIED):
32GB or 64GB Pi 5, covered by a ridged heatsink, with access to
microSD, 128GB its other ports and GPIO header. The motherboard
or 256GB SSD includes extra connectors for 5V out (for an

D
optional LCD screen), speakers (4Ω 3W stereo), and
esigned for industrial settings, the ED- extended PoE. On the underside, requiring removal
IPC3020 houses a Raspberry Pi 5 and an of the base to access, are an RTC battery holder (for
extra motherboard inside a robust metal
case. That motherboard provides a few more ports
and features. On the front, alongside the usual USB Y ou can buy the unit
and Ethernet ports, are 3.5mm audio in and out
jacks, four LED indicators, plus a couple of three- with an optional 128GB
pin connectors for RS-232 and RS-485 – used
to connect industrial-standard add-ons such as
or 256GB SSD installed
Verdict sensors and relays.
or add your own
There’s a slot in the case for the microSD
A solid unit with card, although you’ll need tweezers to pull it out
super cooling and
extra features,
again. Power is via USB-C using a standard 5V/5A CR1220) and an M.2 M Key connector for an NVMe
but no DIN rail Raspberry Pi 5 PSU, rather than the 8–24V barrel SSD stick. You can buy the unit with an optional
mounting option. jack used in previous EDATEC IPC models. 128GB or 256GB SSD installed or add your own.
The lack of a fan is no problem as the passive

8
cooling from the two heatsinks is highly
Inside the case effective. During a 30-minute stress test, the CPU

/10
Removing a few screws enables you to remove temperature reached a maximum 59.3°C, nowhere
the top of the case. Inside, you’ll find Raspberry near the level requiring throttling.

76 magpi.cc ED-IPC3020
Learn coding
Discover how computers work
Build amazing things!

magpi.cc/beginnersguide
PLAY
& CODE
GAMES!
RETRO GAMING WITH

RASPBERRY PI 3 RD E D I T I O N
Retro Gaming with Raspberry Pi shows you how to set up
Raspberry Pi 5 to play a new generation of classic games. Build your
gaming console and full-size arcade cabinet, install emulation software
and download original games with our step-by-step guides. You’ll
discover a vibrant homebrew scene packed with new games for original
consoles and legal access to all those retro games you remember!

Set up Raspberry Pi
for retro gaming
Emulate classic
computers and consoles
Learn to code
retro-style games
Build a console,
handheld, and full-size
arcade machine

BUY ONLINE: magpi.cc/store


RESOURCES

10 amazing:  Raspberry Pi Microwave

cooking QR cooking
‘Food should have a QR code your microwave can read’ is an excellent

projects
thesis statement, and this Raspberry Pi-powered Microwave does
exactly that. It’s manually programmable too.

magpi.cc/rpimicrowave

Use your Raspberry Pi


in the kitchen as your
own personal sous chef

W e’ve done a couple of kitchen-y cookery sorta


tutorials and features in the past because, well,
there are many expensive cooking gadgets and
it would be cool if you could make something similar for
a fraction of the price. This is where Raspberry Pi comes in,
with these ten excellent projects.

 OnionBot
Perfect caramelisation  Smart kitchen display
Using computer vision, this project
keeps an eye on your food while Info at-a-glance
you’re otherwise distracted, Smart displays are a similar kind of project to a magic mirror, and this
controlling the power of an induction one is designed for the kitchen. We’d add some recipe web pages
hob. It was originally made to help ourselves, along with measurement converters.
create perfectly softened onions.
magpi.cc/kitchensmart
magpi.cc/onionbot

 Food burning detection


Pico smoke detector
Instead of using cameras to detect how your food is cooking, this
Pico project uses various gas sensors. You really shouldn’t step away
from a lit hob though.

magpi.cc/burning

80 magpi.cc 10 amazing cooking projects


RESOURCES

Warning!
Electrical Safety
Many kitchen gadgets
use high-power circuitry,
be extremely careful if
you plan to copy one
of these projects

magpi.cc/
electricalsafety

 AI steak cooking


Rare find
Somehow, by using a large language model
– this case ChatGPT – you’re able to analyse
pictures of steak to make sure it’s cooked
exactly how you like. Even if that is well done.

magpi.cc/aisteak

 Please, Your Fridge


Recipe suggester
Use image recognition to figure out what recipes you can make with  PiFire
what’s in your fridge! We need one to include our cupboards too.
Barbecue control
magpi.cc/pleasefridge Smoking meat can be a long and tricky process, and it’s very annoying
when it fails. Make it easier by using a Raspberry Pi to control it all.

magpi.cc/pifire

 Pico Sous Vide


Water baths
Sous vide involves
cooking vacuum-sealed
meats at the exact right
temperature for a long
time, resulting in out-of-
this world dishes.

magpi.cc/picosv
 Raspberry Pi
controlled oven
 Beer brewing
Reliable baking
If you’ve ever had an oven that Ale’s well
doesn’t keep a constant temperature, In issue 130 we covered brewing
you’ll know it’s tricky to cook some beer, using Raspberry Pi to make
things properly. Fix it with better the perfect alcoholic beverage
temperature control. to your tastes.

magpi.cc/ovencontrol magpi.cc/130

10 amazing cooking projects magpi.cc 81


RESOURCES

Learn Java with


Raspberry Pi
Discover more about Java programming
with these handy resources. By Phil King

Java Programming
University Java is one of the world’s
AUTHOR

of Helsinki most popular programming


languages. Object-oriented, it’s
Price:
Free highly versatile and fairly easy
to learn. You can code with it
magpi.cc/javamooc
on Raspberry Pi using Visual
Studio Code to create applets
that will run on any machine
with Java Runtime Environment
(JRE) installed.
With no previous experience take around ten hours each to The numerous programming
required, this unabridged complete. These take you all the exercises throughout need
MOOC (massive open online way from the basics to tackling to be completed using the
course) will teach you a whole more advanced concepts such as Netbeans IDE with the Test My
lot about Java programming. hash maps, collections, streams, Code plug-in, so you’ll need to
Two main course sections each type parameters, GUIs, and install that along with the Java
comprise seven modules that data visualisation. JDK if you don’t have it.

Online courses Enrol in a Java coding web course today


HYPERSKILL JAVA covers the basics well, along with
The Hyperskill learning platform’s some more complex concepts.
Java section offers several ‘tracks’ X magpi.cc/udemyjava
designed for coders and developers
of different experience levels. JAVA MULTITHREADING
X magpi.cc/hyperjava Another one from Udemy, this
three-hour video course is all
JAVA TUTORIAL FOR about multithreading – executing
COMPLETE BEGINNERS two or more threads simultaneously
A good introduction, this video-based on the CPU.
Udemy course is a little dated but X magpi.cc/javamulti

82 magpi.cc Learn Java with Raspberry Pi


RESOURCES

CodeGym
CodeGym One of the best ways to learn online environment. A gamified
Further
AUTHOR

Java is to get hands-on with it. course with several quests


Price:
Free trial / $49 pcm
Rather than download an IDE comprising multiple levels, reading
to run code locally, CodeGym it involves tackling 1200+
codegym.cc
offers the more convenient hands-on tasks of increasing
option of programming in an complexity. ‘Dark matter’ Books to help you
earned from completing lessons learn more about Java
and tasks is used to unlock
the next ones. You can even
create your own versions of
classic games such as Snake and
publish them for friends to play.
While some quests and
levels are free, to unlock them
all you’ll need to pay for a
monthly subscription (or access
the site via your educational
establishment), but the course
has a fun theme and is highly
recommended for beginners.
JAVA: A BEGINNER’S GUIDE
A comprehensive Java textbook,
now in its ninth edition, it covers

Head First Java – 3 Edition


fundamentals, OOP, advanced
rd topics and GUI development,
with self-tests and projects.
X magpi.cc/javabeginners
Kathy Sierra, Aimed at absolute beginners, variables, inheritance,
AUTHOR

Bert Bates, this 752-page book delivers a polymorphism, constructors,


Trisha Gee thorough introduction to object- data structures, lambdas, INTRODUCTION TO JAVA
Price:
oriented programming and streams, and a whole lot more. PROGRAMMING AND
£64 / $80 Java. This third edition has been Each chapter features several DATA STRUCTURES
updated to cover Java versions 8 exercises with solutions. This hefty tome offers a
magpi.cc/
headfirstjava3e to 17. While pricey, it’s currently fundamentals-first approach,
available at a big discount. integrating programming, data
Like other Head First books, structures, and algorithms while
it has a fun, visually rich format emphasising problem-solving
“designed for the way your and practice.
brain works”, offering multiple X magpi.cc/introjava
learning styles. It’s also written
in an entertaining way with
short stories, mysteries, and EFFECTIVE JAVA
puzzles to help keep the reader For seasoned Java developers
engaged in the learning process. seeking to improve their
If other Java books or courses skills, this guide offers 90 best
have left you befuddled, this practices covering methods,
could be the answer. generics, concurrency, and
Chapters cover topics serialisation techniques.
including classes, objects, X magpi.cc/effectivejava

Learn Java with Raspberry Pi magpi.cc 83


INTERVIEW

Brian
O’Halloran
The Raspberry Pi Brand Manager helps makes sure
everything you see is beautiful and consistent

> Name Brian O’Halloran > Occupation Brand Manager


> Community role Raspberry Pi visuals > URL raspberrypi.com

W e’ve been working


with Brian ever since
he joined Raspberry
Pi as a photographer and
videographer – both for covers,
“My career was born out of
utter post-school indecision,”
Brian admits. “I studied
multimedia at uni, and even
though it involved studying
and was fortunate enough
to get work in a great small
video-production studio there.
As well as corporate video, a
considerable portion of my
photos, and fun videos. We things like web development summers were spent filming
should get back to those videos and data science, I decided that weddings, to which I owe a
one day, but his creativity and messing around with a camera considerable amount of my
T A personal photograph of
Gyeongju-gi taken from expertise have not only elevated was surely the most fool-proof run-and-gun experience and a
South Korea the magazine but also everything way to make a living. I moved permanent shoulder weakness
you see out of Raspberry Pi. to Vancouver to ply my trade, from carrying upwards of
10KG of camera gear in a tiny
shoulder bag.”

When did you first learn about


Raspberry Pi?
When I was in uni I had a
lecturer with reasonably
eccentric interests. At the
time he was teaching us 2D
animation, but it could easily
have morphed into a class about
botany or the history of zips.
He once mentioned a thing
called a Raspberry Pi in one of
his classes, but I had just filed
it under another one of his
esoteric interests, not knowing
the massive role it would play
in my life years later.
Also, did you know that the
modern zipper as we know it
was first used in 1923?

84 magpi.cc Brian O’Halloran


INTERVIEW

W Raspberry Pi in-house
photography

X A creative cracked-mirror
shot from Shoreditch

What’s your favourite thing plays the Simpsons non-stop


you’ve done with Raspberry Pi? was a source of immense joy.
Overcome by intense paranoia This is where I out myself as one T he TV that plays the Simpsons
before a holiday, I made a security
camera that I could remotely
of those tiresome people who
say “ONLY SEASONS 3 TO 10
non-stop was a source of joy
access to check in on the house. THOUGH PLEASE” (which I say
Of course what I neglected to do because it is objectively correct) recent work is some of the
was set it so that it stored photos [Ed note: he’s right]. stuff that I am most proud of.
on a server, but that was a great Raspberry Pi 5 stands out as a
idea for version 2. Version 2 has What are some of your favourite highlight, but mostly because
yet to materialise. videos/photos you’ve made for it was such a collaborative
Raspberry Pi? experience with a lot of my
What’s your favourite uses of As someone dragged through very talented colleagues.
Raspberry Pi that you’ve seen? the insidious mincer of the I did take the photo for
As someone whose brain is creative industry I am habitually the cover of the issue you’re
90% Simpsons quotes to incapable of finding nothing but reading, so if you like that then
the detriment of all other fault in my own work. I am in a that’s cool. If you don’t, well,
knowledge, seeing someone constant state of improvement thankfully you can’t leave a
make the Simpsons TV that and I would say that my most comment on a magazine.

W Raspberry Pi 4 boards
being soldered on the
line at Sony Pencoed
factory, Wales

Brian O’Halloran magpi.cc 85


THIS MONTH IN RASPBERRY PI

Events in pictures:
Mayday Pi Jam
in Leicester
FIN
NEX T D OU T AB
Community and official events in the wild AND
M ON O
TH’S U T
POP-U EVEN TS
P S ON

H
PAGE
eld at Leicester Hackspace, this event 92
focussed on camera projects, with
members of the hackspace old and new
(and lapsed!) coming along to see some cool
projects. Here’s a small report from the event
organiser Steve Gale.
“The All Sky camera was popular, with images
from Leicestershire, plus some photos taken in
South Australia with an identical device, We were
all jealous of the photos of the milky way! We also
had a Raspberry Pi 5 controlling a servo using
gestures, based on one of “Kevs robots” projects,
plus a USB controlled arm. Another member set up
retro-pie. Our youngest member Anna showed off
her nature cam using a Raspberry Pi Zero W.”

01. The All Sky camera has been featured before in


the magazine – it’s an all-weather long exposure
astrophotography project 04
02. PiFinder is also an astronomy build, allowing you
to look at and track celestial bodies as they move
through the night sky
02
03. Apparently 25 people came to the makerspace
throughout the day
04. Other projects were on display for people to look at

03 01

86 magpi.cc Events in pictures


THIS MONTH IN RASPBERRY PI

W It’s quite compact in a car,


and modern cars seem to

Offline
have an abundance of USB
ports to use too

T The bill of materials is very


small – it’s mostly software

S After eating some chocolate, you just want to

GPS
fly around the sky in some virtual planes

tracking
Track your movements and map your past
route, no mobile internet required

D arko Golner from Croatia emailed us with


his comprehensive tutorial for creating
something he calls raspi-gps.
“This simple project raspi-gps is a small GPS
tracking system I made using Raspberry Pi and an
T Using a Raspberry Pi Zero
keeps it very compact

external GPS Bluetooth module,” Darko writes on


his GitHub. “This device is conceived as offline
tracking, just connect it to a USB in the car, turn
it on and record movement without connecting
to the Internet. Since the movement (change of
GPS position in time) is recorded in the form of
GPX files on the SD card, it’s possible to load such
routes in external applications such as Google
Earth by downloading from the SD card.”
He’s not kidding when he says its comprehensive
– the GitHub page (magpi.cc/raspigps) is very
detailed, with all the code open source and ready to
use. Happy tracking.

Offline GPS tracking magpi.cc 87


THIS MONTH IN RASPBERRY PI

03

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
send us amazing photos and videos of the things
they’ve made.
02

Here’s a selection of some of the awesome things


we got sent this month. Remember to follow along
at the hashtag #MagPiMonday!

01. This PCB has escaped the confines of the Raspberry


Pi footprint in pursuit of greater musical fidelity
02. Hook this up to a VR headset and you could feasibly
ride your own rails
03. Very pretty lights! Reusable for Christmas as well
– although we wouldn’t personally sleep in a tent
in December
04. I wonder if we can ask it to be big and dance on a
piano with Robert Loggia
05. Yep, this looks perfectly normal for Jeff – carry on
06. The CinePi range of cameras always seem to be
getting better and better

01

88 magpi.cc #MagPiMonday
THIS MONTH IN RASPBERRY PI

05

04

06

Crowdfund this
Raspberry Pi projects you can support this month

PiWings 2.0 CodeRover ATV


& Snowcat

PiWings 2.0 is finally live, this custom flight controller The latest CodeRover is a beefy looking robot, with its friend
for Raspberry Pi Pico-powered drones is designed Snowcat complete with treads for rough terrains – maybe
specifically for educational purposes but we won’t tell this would be a good platform for a science smart robot. They
anyone if you use it to make a cheap, light drone for you come with the ability to add a huge number of add-ons, and
to play around with are fully programmable.

f kck.st/3x6epnY f magpi.cc/coderoveratv

#MagPiMonday magpi.cc 89
YOUR LETTERS

Your
Letters
Upgrade worries
I’m worried, and maybe others are too. Or have I misunderstood Updating Raspberry Pi OS, which is based on Debian Linux, is a
something? I have a nice Raspberry Pi 5 8GB with M.2 HAT+. little different to doing the same thing in Windows. Depending on
I’m booting from the M.2 and took out the microSD card. So I’ve how you use it, you won’t necessarily need to update it anyway.
loaded up Apache and MySql and some web pages and various However, if you want you can get some more software updates by
other software and lots of MP3s, and am about to play with using the command sudo apt dist-upgrade instead of upgrade in
AI. I’m running Bullseye... but what happens when I want to the command line.
upgrade to Bookworm? The recommended route seems to be to If you decide you do want to update to the next version
use Imager... but won’t I lose everything I installed? of Raspberry Pi OS properly, though, you will need to install
I’m not sure I’m up to a manual update – possibly rpi-update it from scratch. Luckily, you can back up your Home folder,
– but I’d feel safer doing that and a backup with you holding my along with settings for important apps, and return most of them
hand. Can you show me (and others) how please? once installed. It’s likely you will have to set up some of your
software again though.
We haven’t done a backup article in a while though, so perhaps
Paul via email that is something for the future!

X Due to the way


Linux works, you
can’t always update
Raspberry Pi OS in the
same way as other
operating systems

90 magpi.cc Your Letters


More a message of support USA SPECIAL!
I love to have your magazines in paper form,
sadly I can’t afford to buy them all every month
so rely on the PDFs (they’re also SOOO much
6 ISSUES
FOR $43
easier to store).
The decision to not make them available right
away seemed like a shame, but thinking about
it, I whole heartedly support the idea. Waiting a
little while doesn’t make the magazines any less
useful or informative.
Thank you all for the amazing magazines
and articles.

Ben via email

Yes storing the PDFs is much easier – over time


we find ourselves checking the PDFs more than the
physical references ourselves! If you keep an eye on
the blog, content from the current issue also makes
its way there, so you can read a good portion of the
magazine ahead of the free PDF release.

FREE
RASPBERRY PI
S Our back issues aren’t going anywhere either PICO W

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

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

04

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

01. M
 elbourne Raspberry Pi Meetup 03. Experience Raspberry Pi @ Purple Space
Sunday 7 July Sunday 7 July
107 Victoria Harbour Promenade, Melbourne, Australia Purple Space Library, Udupi, India
magpi.cc/mrpm143 magpi.cc/ps143
This meetup is open to everyone with an interest in Raspberry Pi enthusiasts come together to share their
electronics, robotics, home automation, 3D printing, laser passion for creating and designing projects with Raspberry
cutting, amateur radio, high altitude balloons, space tech, Pi technology. This is an opportunity to empower young
etc. Makers are invited to bring along their projects and minds to learn computing using Raspberry Pi and become
project ideas, and come connect with other makers. Get your confident innovators and creative digital makers Get to see
questions answered, show off the work you are doing, and the newest addition to the Raspberry Pi product family, the
get support to resolve nagging issues. Raspberry Pi AI Kit with the Hailo-8L co-processor, a 13 trillion
operations per second (TOPS) neural processor, making
02. Japanese Raspberry Pi Users Group at edge machine learning and computer vision much faster on
Open Source Conference Kyoto 2024 a Raspberry Pi.
Saturday 27 July
Kyoto Research Park, Kyoto, Japan FULL CALENDAR
magpi.cc/jrpug143 Get a full list of upcoming
​Japanese Raspberry Pi Users Group is coming to the community events here:
Open Source Conference in Kyoto in June! We will exhibit magpi.cc/events
Raspberry Pi 5 and Raspberry Pi use cases. Please join if you
live in the Kansai area of Japan!
04. Riverside Raspberry Pi Meetup
Monday 8 July
3600 Lime Street, Riverside, CA, USA
magpi.cc/rrpm143
The purpose of Riverside Raspberry is to share knowledge
related to Raspberry Pi hardware in particular, and to
promote interest in tech development in the Inland Empire
in general. The group is currently meeting on the second
Monday evening of every month.

92 magpi.cc Community Events Calendar


EVENTS

02

03

01

MAKER FAIRE HANNOVER


Maker Faire
Hannover
> Where Hannover Congress Centrum, Hannover, Germany
> When Saturday 17 August and Sunday 18 August

W e’re proud to partner with Raspberry


Pi Approved Reseller BerryBase to be at
Maker Faire Hannover for the second year
in a row. Come and meet members of the Raspberry Pi
team, learn about our latest products, and share what
you’ve made with Raspberry Pi technology.

magpi.cc/mfh24

Community Events Calendar magpi.cc 93


COMPETITION

WIN ONE OF FIVE


RASPBERRY PI
AI KITS
Hot on the heels of the M.2 HAT+ is the full AI Kit
in collaboration with Hailo and featuring the Hailo-8L
AI accelerator module. Use it for local machine learning
and neural networks that work great with AI vision via a
Raspberry Pi Camera Module.

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

Terms & Conditions


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

94 magpi.cc WIN one of five Raspberry Pi AI Kits


SUBSCRIPTION

200 PAGES OF RASPBERRY PI


QuickStart guide to setting up The very best projects built by
your Raspberry Pi computer your Raspberry Pi community

Updated with Raspberry Pi Pico Discover incredible kit and


and all the latest kit tutorials for your projects

Buy online: magpi.cc/store 95


SUBSCRIBE AND

SAVE UP
TO

35% on the cover price

ISSUE #80

OUT NOW
hsmag.cc
NEXT MONTH

EDITORIAL
Editor
Lucy Hattersley
[email protected]
Features Editor
Rob Zwetsloot
[email protected]
Sub Editor
Ian Evenden

ADVERTISING
Charlotte Milligan
[email protected]
+44 (0)7725 368887

DESIGN
Head of Design
Jack Willis
Designers
Sara Parodi, Natalie Turner
Illustrator
Sam Alder
Photographer
Brian O’Halloran

CONTRIBUTORS
James Adams, Nate Contino,
David Crookes, PJ Evans,
Rosemary Hattersley, Phil King,
Dr Andrew Lewis, Sean McManus,
Naush Patuck

PUBLISHING
Publishing Director
Brian Jepson
[email protected]

Smart
Director of Communications
Liz Upton
CEO

Electronics
Eben Upton

DISTRIBUTION
Seymour Distribution Ltd
2 East Poultry Ave,
Boost your projects with wires, buttons, and components! London EC1A 9PT
+44 (0)207 429 4000

SUBSCRIPTIONS
Unit 6 The Enterprise Centre

The Magpi #144 Kelvin Lane, Manor Royal,


Crawley, West Sussex, RH10 9PE
+44 (0)1293 312193
On sale 25 July magpi.cc/subscribe
[email protected]

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


from sustainable forests and the printer

Photography
operates an environmental management
MASTODON magpi.cc/mastodon system which has been assessed as
conforming to ISO 14001.
projects The MagPi magazine is published by
THREADS @themagpimag Raspberry Pi Ltd, 194 Cambridge Science

Talking
Park, Milton Road, Cambridge, England, CB4
0AB. The publisher, editor, and contributors
accept no responsibility in respect of any
tomato plants FACEBOOK magpi.cc/facebook omissions or errors relating to goods,
products, or services referred to or advertised
in the magazine. Except where otherwise

Learn to EMAIL [email protected] noted, content in this magazine is licensed


under a Creative Commons

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

Public
Raspberry Pi has hit the stock market. Rob Zwetsloot finds out what this means
If you’ve been reading the financial “And the start of a new phase in to finance a sustainable expansion
papers over the last few months, you’ll our evolution: access to the public of our educational activities. Put
have been aware that Raspberry Pi was market will enable us to build more simply, instead of receiving a share
looking to float on the stock market. of the products you love, faster. And of the company’s profits each
This is, understandably, quite a big the money raised by the Raspberry Pi year, we will convert some of our
deal, so when I got the email sent Foundation in the IPO will support shareholding into an endowment
around to staff asking if they’d want its ambitions for global impact in its that we will use to fund our
to go to the London Stock Exchange second decade.” educational programmes.”
for 7:45 AM on a Tuesday morning for Philip Colligan, CEO of the
the launch, I gracefully... declined. Raspberry Pi Foundation wrote in What’s next
Unfortunately, my car was due to be a post a couple of weeks ago just There’s been a whole lot of work
returned to me after some repairs (hit how that would work: “To date, behind the scenes for this for some
and run on the motorway time now – I’ve only caught
at 70; I was fine, my glimpses on my monthly
car not so much), and  oney raised by the Raspberry Pi
M visits to Raspberry Pi Towers
also, I didn’t really fancy – so hopefully some of
getting up at 3am to get Foundation in the IPO will support that pressure has now been
to London in time. Lucy alleviated. I’ll find out on
went though, so there was its ambitions for global impact in my next visit.
The MagPi representation
there for the big moment
its second decade Anyway, I thought I’d
talk about it here as for
where the button was various reasons we’ve not
pressed to open the had a chance to mention it
market. The video feed made the Raspberry Pi Ltd has donated elsewhere in the magazine [lots of
whole thing look very cool, with nearly $50m from its profits to the exciting new opportunities to end up
fancy light displays and video to Foundation, which we have used to in front of a judge - Ed]. Also, my car
signify the event. I wonder if the City advance our educational mission got returned the following day and
uses Raspberry Pi for that – it would combined with over $60m in funding now I sort of regret not having got up
be very fitting. from philanthropy, sponsorship, early for it. Ah well – onwards.
and contracts for educational
Rob Zwetsloot
AUTHOR

Evolution services,” he wrote. “From the


“This is a watershed moment for Foundation’s perspective, an IPO Rob is the Features Editor of The MagPi
Raspberry Pi,” Eben posted on provides us with the ability to sell and is too fond of sleep

Raspberry Pi dot com that morning. some of our shares to raise money magpi.cc

98 magpi.cc Public
HIGHPI PRO
The new case from the HiPi.io team

Rapid tool-free assembly and disassembly Secure microSD card cover


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

Available at these great Pi stores:

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


PiKVM
Manage
Manage your
servers
servers or PCs
remotely!
remotely!

Remote control redefined

PiKVM V4 Mini
Small, cost-effective, and powerful!

Power consumption in idle mode: just 2.67 Watts!


Transfer your mouse and keyboard actions
Access to all configuration settings like UEFI/BIOS
Capture video signal up to 1920x1200@60 Hz
Take full control of a remote PC’s power

PiKVM V4 Plus
The most feature-rich edition

More connectivity
Extra storage via internal USB 3.0
Upgraded powering options
More physical security features
Extra HDMI output
Advanced cooling solution

A cost-effective solution for data-centers,


IT departments or remote machines!

Availableatatthe
Available themain
mainRaspberry
Raspberry Pi
Pi resellers
resellers

List of official
resellers by country:

You might also like