HackSpace Magazine - Issue 50

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

hsmag.

cc January 2022 Issue #50

VINYL RP2040
CUTTING The best dev
boards tested
Customise your mug

Improve your builds with


artificial intelligence

DIY
LIGHT CHRISTMAS
PAINTING
Jan. 2022
Issue #50 £6
LIGHTS
Take photography Control lots of LEDs
to the next level this festive season

WRAPPING 3D PRINTING PYTHON LATHES www.dbooks.org


WELCOME EDITORIAL
Editor
Ben Everard
[email protected]

Welcome to Features Editor


Andrew Gregory
[email protected]

HackSpace magazine Sub-Editors


David Higgs, Nicola King

DESIGN
You might be familiar with the Gartner Hype Cycle. The Critical Media
basic idea is that when technologies are young, they get a criticalmedia.co.uk

Head of Design
lot of media attention, but they’re not yet mature enough to Lee Allen
be actually useful. This inevitably leads to disappointment Designers
Sam Ribbits, Olivia Mitchell,
as the wild claims made about the technology don’t Ty Logan
miraculously come true quickly. However, after the media Photography
attention has died down, the technology quietly matures Brian O’Halloran

without much fanfare. As time goes on, it gradually becomes CONTRIBUTORS


Jo Hinchliffe, Marc de Vinck,
more and more useful, and this time, excitement grows with Rob Miles, Andrew Lewis,
Rosie Hattersley, Nicola King,
actual usefulness. Phil King, Didier Briand
It’s this latter stage that machine learning is now in. Ten PUBLISHING
years ago, it was all hype and of little practical use. Now, Publishing Director
Russell Barnes
the tools and techniques have moved on to the point where [email protected]

it’s possible for a moderately technical person, with a bit of Advertising


Charlie Milligan
programming skill, to make a useful project using machine [email protected]
learning. It’s not about to solve all the world’s problems (as
DISTRIBUTION
some of its more vocal proponents used to claim), but it can Seymour Distribution Ltd
be a great tool for analysing data about the real world. In this 2 East Poultry Ave,
London EC1A 9PT
issue, we’re taking a look at some of our favourite projects +44 (0)207 429 4000

that show off different aspects of machine learning. Flip to SUBSCRIPTIONS


age t find ut m re Unit 6, The Enterprise Centre,
Kelvin Lane, Manor Royal,
Got a comment, Crawley, West Sussex, RH10 9PE
BEN EVERARD
question, or thought To subscribe
about HackSpace Editor [email protected] 01293 312189
magazine?
hsmag.cc/subscribe

get in touch at Subscription queries

44
hsmag.cc/hello
PAGE
[email protected]

GET IN TOUCH FREE PICO This magazine is printed on


hackspace@ WHEN YOU paper sourced from sustainable
raspberrypi.com forests. The printer operates an
SUBSCRIBE environmental management system
hackspacemag which has been assessed as
conforming to ISO 14001.
hackspacemag HackSpace magazine is published
by Raspberry Pi (Trading) Ltd.,
Maurice Wilkes Building, St. John’s
ONLINE Innovation Park, Cowley Road,
Cambridge, CB4 0DS The publisher,
hsmag.cc editor, and contributors accept
no responsibility in respect of any
omissions or errors relating to goods,
products or services referred to or
advertised. Except where otherwise
noted, content in this magazine is
licensed under a Creative Commons
Attribution-NonCommercial-
ShareAlike 3.0 Unported (CC BY-NC-
SA 3.0). ISSN: 2515-5148.

3
www.dbooks.org
Contents 112

06 SPARK 31 LENS
06 Top Projects 32 Machine learning
Beautiful, functional builds made by real people Teach machines to think for themselves. What could go wrong?

18 Objet 3d’art 46 How I Made: Pilightpaint


Bring light to the dark months of winter Light painting in high-definition

20 Meet the Maker: Lewis Aburrow 52 Interview: Matt Stultz


Learning and sharing with DIY Machines Meet the Head of Community at Prusa Printers

26 Letters 60 Improviser’s Toolbox Wrapping paper


3D printing: overhyped or just really useful? Things to make and do with excess paper

28 Crowdfunding now
Light up your letters
Tutorial
Vinyl cutting
Cover Feature

94 Customise T-shirts, mugs, and


almost anything else, with a Cricut

Add brains to your builds


with artificial intelligence 60

32
4
CONTENTS

74
06

Direct from Shenzhen


Heat gun

46
Meet the Maker
Lewis Aburrow

102

108 Solder tricky components


with the power of hot air

73 FORGE 20 On the unexpected loveliness


of the maker community

74 SoM Pico gearbox

66
Resurrect a broken lathe with a Raspberry Pi Pico

80 Tutorial Parallel NeoPixels


Power 26 chains of NeoPixels in one go

82 Tutorial Sensors
Detect gases with a Raspberry Pi 101 FIELD TEST
86 Tutorial FreeCAD 102 Best of Breed
Design for building with folded metal The best development boards for RP2040

94 Tutorial Vinyl cutting 108 Direct from Shenzhen Heat gun


Clean, automatic designs with Cricut A budget solution for surface-mount soldering

98 Tutorial Festive lights 112 Review Seesaw


Custom blinkenlights for your Christmas tree Add extra features to your microcontroller

Some of the tools and techniques shown in HackSpace 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. HackSpace Magazine is intended for an adult audience and some projects may be dangerous for children. Raspberry
Pi (Trading) Ltd does not accept responsibility for any injuries, damage to equipment, or costs incurred from projects, tutorials or suggestions in HackSpace Magazine. Laws and regulations covering many of the topics
in HackSpace 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 HackSpace Magazine may go beyond. It is your responsibility to understand the manufacturer’s limits.

5
www.dbooks.org
Top Projects

REGULAR

Marblevator
By Greg Zumwalt hsmag.cc/Marblevator

W
e love simplicity, but we also love the whirr
and click of moving parts working exactly
as they should. That’s why this build by Greg
Zumwalt stands out: it’s just so precise.
This circus-themed marble run comprises
50 unique 3D-printed parts, many of which fit
into confined spaces, needing very precise alignment. Because of
that, Greg used the Engineering Profile in Ultimaker Cura to slice his
models, and did a dry run before he glued anything together.
Mechanical parts include a motor, power supply, 32 3×1.5 mm
neodymium magnets, two 6×1.5 mm magnets, and two 8 mm ball
bearings. Greg’s made all the design files available, so if you feel like
a challenge, have a go yourself!

Right
Missing your ball
bearings? Watch out
for giraffes, notorious
thief of round metal

6
SPARK

7
www.dbooks.org
Top Projects

REGULAR

Moon Phase Clock


By James Mabon hsmag.cc/MoonPhaseClock

J
ames Mabon wanted a project for his new 3D
printer, and to give himself an excuse to learn
Fusion 360. So here’s what he created: a clock that,
as well as telling the time, shows you the phase of
the moon. This wasn’t just a 3D printing challenge:
astrophysics is notoriously difficult, and James made
a few simplifications to the mathematical model he used, ignoring
the way the moon wobbles on its axis, as well as a couple of
other things. Nevertheless, the gear train he’s used to show the
constantly shifting phases of the moon is astonishingly accurate,
having a deviation of less than one minute in 25 years.

Right
The 3D-printed
model of the moon
was already provided
(it’s on Thingiverse
here: hsmag.cc/
NASAMoonKit)

8
SPARK

9
www.dbooks.org
Top Projects

REGULAR

Tiny Mac
By C Genco hsmag.cc/MicroMac

C
alifornian computer company Apple now houses
its machines in machined aluminium, but there
was a time when, like all other computer makers,
they housed their wares in a rich shade of beige.
If you miss those primitive days, you can now print
your own very small Macintosh computer on which
you can play Lemmings, surf the web, and do whatever else you
can do on a Raspberry Pi Zero W.
You’ll need – no surprise here – a Raspberry Pi Zero W, plus the
headers to attach to the GPIO pins, a power supply, and a mini
HDMI to HDMI cable (for setup). The most important component
however is the screen: this design uses a 640×480 LCD display;
if you can’t find one of these, or if the screen you use is a slightly
different size or shape, you’ll have to tweak the design of the case.
Thankfully, you can, as the maker has shared all the files.

Right
C Genco has created
two versions of this
design: one with
the SD card slot on
the side, and one
with it on the front,
where the disk drive
went on the original
machine

10
SPARK

11
www.dbooks.org
Top Projects

REGULAR

Fibonacci
Spiral Clock
By Bushra Juwairia Mulla hsmag.cc/FibonacciClock

S
ome of the builds we see are fiendishly
complicated, full of moving parts, CAD, and
advanced techniques that we promise ourselves
we’re going to learn about one day. Some builds,
in contrast, are so beautifully, brilliantly simple that
we know we could replicate them right away, but
there’s no point, as the original is perfect. This clock, inspired
by the Fibonacci series of numbers, is one such example of
simple perfection.
Bushra’s creation uses the guts of a standard wall clock, which
he’s mounted to a single piece of stainless steel, bent so it’ll stand
up. He’s kept the minute hand, but the hour hand has been replaced
by a spiral modelled after the Fibonacci curve, which tells the time
as it turns by overlapping markers placed on the steel.

Right
A true Fibonacci
curve never
touches in the
centre; this version
has been modi ed
so it can exist in
the real world

12
SPARK

13
www.dbooks.org
Top Projects

REGULAR

Quantum
Death
Machine
By Gocivici hsmag.cc/QuantumDeathMachine

I
f you had a background in quantum physics, what
would you build? A time machine? A teleporter? Or,
a box that detects the presence of a human, then tells
them how they’re going to die (based on utterly nothing)?
Maker Gocivici decided to do the latter, and here it is: the
Quantum Death Machine. It’s an audacious exercise in over-
engineering, using IBM Quantum – an online quantum computer
that can provide truly random data (randomness is something that
computers struggle with on their own).
It also uses a Raspberry Pi 3, an Adafruit thermal printer, an
Arduino Nano, and a fingerprint sensor.
In use, the clever quantum computing is hidden away: the user
sticks a finger into the opening where the sensor is mounted, the
machine registers that you’re there, then it gives you a prediction
of how you’ll meet your end. That’s it. It doesn’t ask if you smoke,
drink too much, drive without a seatbelt on, or any of that; it just
uses the randomness of quantum computing to print you a response
from a pre-populated list of deaths.

Right
Death by “Bees” is
something we’re
keen to avoid

14
SPARK

15
www.dbooks.org
Top Projects

REGULAR

Darrieus
Wind Turbine
By Adrian Cubas hsmag.cc/DarrieusWindTurbine

T
his isn’t the first, or the most complicated wind-
powered generator we’ve featured in HackSpace
magazine – that honour falls to WinDIY, the
completely 3D-printed, beautifully engineered
creation by Fabian Scherschel. This creation, by
Adrian Cubas, is very different, but it shares some
similarities. First of all, it’s a vertical axis turbine, meaning that
the user doesn’t have to constantly adjust its position so that it’s
facing the wind. Secondly, it’s 3D-printed, and it’s also a great
educational tool.
The difference is mainly in the simplicity – instead of extruded
aluminium, steel rods or the like, this model used only 3D-printed
parts and something that every teacher should have plenty
of: pencils.

Right
The Darrieus wind
turbine is named
after its inventor,
French engineer
Georges Darrieus

16
SPARK

17
www.dbooks.org
Objet 3d’art

REGULAR

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

T
he menorah is used to mark the
days of the Jewish festival of
Hanukkah; to mark each day of
Hanukkah, you’d normally light a
candle each day. This
interpretation by the Ruiz Brothers uses
NeoPixels instead of candles, in a simple
3D-printed frame, which prints with no need
for supports, thanks to its clean design. Even
the bulbs are 3D-printed – in this case in
translucent PLA to diffuse the light.
Intelligence is provided by an Adafruit QT
Py RP2040, which takes in power through a
USB-C socket at the back of the menorah,
and spits out CircuitPython logic to light one
additional bulb per button press.

hsmag.cc/Menorah

18
SPARK

19
www.dbooks.org
Meet The Maker

REGULAR

Meet The Maker:


Lewis Aburrow
Keep learning, even when things go wrong

S
elf-taught, masterful command of “I got kind of frustrated with those, because I
3D printing, CAD, electronics. There’s thought if I’m gonna buy the parts for this video, I
something refreshingly old-fashioned want to make sure it’s going to work and that
about Lewis’s material, which he shares everything they did is documented; they’ve not
at diymachines.co.uk. He’s not trying to skimmed through it to make it look elegant and easy.
constantly release new content to grab So that’s why I tried to document my builds really
the attention; his builds are ready when they’re ready. well, because if someone is going to spend their
Much more than that, they’re a resource for learning pocket money on buying the parts to build it, I want
from. We spoke to Lewis to find out why it’s so to make sure they’re going to be successful. It seems
important to him to make learning accessible, what only fair.
keeps him going when things are going wrong, and “I have a twin brother, and though we live in the
why he’ll never leave electronics unattended again. same town, as life goes, we don’t really see as much
of each other as we probably should. So we decided


to build a bar robot as a project we could make
Someone in Australia could invent something together. We started working on it, and then life got
in the way for him. He got married, they bought a
today, and I can have it on my printer in a new house as well. So he couldn’t show up. And I


was starting to get addicted, because I had heard of
matter of hours – here, physically in my house Arduinos and things like this. The idea of
programming something that could do something in
the real world was really scary. I thought that that
“When I started making things, I knew nothing about was the stuff of universities.
making. I didn’t have any education in electronics or “And then you see a few lines of code can blink an
design or coding or anything like that, so I could only LED or turn a motor left or right. So, I kind of got
learn from looking at other people’s projects. really addicted to this. I’d done a bit of amateur web
“I’d sit and watch them and then suddenly go design, but that’s code on a computer – code that
from one cut to another; there was one I remember could interact with the real world was amazing. I
watching where the person glued something together finished the project on my own, my friends liked it,
and in the next cut there was a screw, so I could see and that’s kind of how it started.
that gluing alone wasn’t good enough… it felt like “Like a lot of makers, I love technology, and I was
a lie. looking for a new hobby. So I backed the Buccaneer

20
SPARK

on Kickstarter by Pirate3D – a controversial one publish something which uses a tool that’s prohibitive
because they went bankrupt before they fulfilled all to a lot of people. So the discs will be 3D-printable, Above
The machine that
the orders. I was one of the very few percent who like these plastic ones. But I’ll also upload wooden started it all: the
actually got a printer. ones, for people who might have access to a laser. Bar Bot, maker of
automated cocktails
“Luckily, though, that sparked an interest in 3D “I had some problems trying to figure out the
printing. At the time, I was building a model railroad, orientation of the discs but I think, as of last night, I
printing elements and things like this. And I outgrew found a way to figure out where they are when it
it quite quickly, because the company wasn’t around, powers up.
there wasn’t a lot of support. So I saved up my “I’ve been printing for about five years. I still find it
pennies, bought myself a Prusa, and that’s how that amazing that I can draw something on the computer,
addiction started. click a button, print overnight, and in the morning I
“At the moment I’m working on a weather bot. It’s a can have a physical copy of what was on the screen
machine which goes to the Internet of Things the night before. To be able to do that, in your own
OpenWeather service to retrieve the forecast for home is insane. It’s amazing. Someone in Australia
today and tomorrow. It uses a series of four discs to could invent something today, and I can have it on my
represent wind, rain, cloud cover, and… another one. printer in a matter of hours – here, physically in my
And once it’s got that data, it rotates the discs, house. It’s incredible.
creating a diorama that illustrates the weather. To
build this one, I had to learn internet APIs – that took
me a while. I’ve never fetched data on the internet
and stored it as a JSON object before. And talking to
an e-ink display – that’s new to me. One day, there’ll
be a project where when I start it, I’m like, I can see
where I’m going. But so far, I mean, it’s great to learn
stuff. It’s what keeps me interested.
“I’m going to keep it all 3D-printable, I am quite
3D-printed orientated. And I don’t want to ever

21
www.dbooks.org
Meet The Maker

REGULAR

themed scenery that changes, and they can have that


for a donation. But I will give away blank discs,
explaining where to put what, so people can design
their own weather dioramas. So, if you want to make
it for family members, you might put in their dogs,
family, or something – [that] would be kind of cool.
“What has really taken me by surprise is that I had a
few people suggest I started a Discord server, so I
did. I thought I would run it for like a month or two,
and then it would just kind of shut it down because
there wouldn’t be anyone there. But no, it’s really
lively. There are so many engaged people – lots of
SHARING IDEAS people who are currently making a project, or have
“I always give everything I make away for free. All made it, and are still hanging around to help other
the plans, the 3D-printed models, the programming, people out.
the code, everything so that everyone can make it. I “With the Sisyphus table, for example, people are
think it’s unfair to put it behind a paywall. But then taking the mechanisms and rearranging it or changing
what I’ll do is, I’ll create an additional something it to create different tables. I’ve seen an absolutely
so that if you want to enhance the project, you can stunning circular version using the same mechanism.
make a donation. In my most recent build, I used There’s another chap who’s building a vertical version
triangular panels in that design. So I created a square into his wall so that it can move things around from
one – I just pop that on my Etsy shop for £3. And behind the wall. He’s into horror films. So he likes the
it’s a way of saying, ‘If you’ve enjoyed it, you could idea of things on his wall just moving around.
kind of donate to the cause. But I’ll also be able to “It’s amazing. If I could spend a year on each
give you back something as well, to say thank you for project, I would, because I always want to polish this,
the donation.’ or I want to revisit that. So I get them so far, then
“That helps out a lot. So with each project, I’ve done part of me says ‘Nope, you got to film it, document it,
that. With the weather bot, for example, the scenery and share it’. So then, when you see other people
that you saw was a cityscape. But I’ll create a second take it further, I’m kind of like, ‘Oh, good, they’ve
set of discs, which might be countryside, or beach- made those improvements, or they’ve revised the

Right
Lewis provides the
design les or
everythng he does,
so if you build the
weatherbot, you can
include your house/
dog/loved ones in
the design

22
SPARK

code’. And I really enjoy seeing it. And sometimes in it, and then you realise ‘Oh, actually, I can’t reach
ways that you didn’t think about, which is even that screw’. So don’t be afraid to fail; fail fast and
Above
more amazing. fail cheaply. Take the drudgery out
“The shelf clock video was over a year ago now. “The Arduino Uno that sparked my interest in these of laying dominoes
with Lewis’ machine
Someone rewrote the code for that, and it was so kinds of electromechanical builds – if it had cost even
good that I ripped the internals out of mine here – the £50, I’d be like, ‘I don’t wanna break that. It’s too Below
We’ve seen these
original one – and put dangerous for me to play kinetic sand drawing


their code and wiring with that’. But the prices tables before, but
never attempted to
design into mine. And I Everyone stands on the I could get them at build one
absolutely love it. It’s encouraged me to have
brilliant. She’s called shoulders of giants, a go, and then you get
Florian; I’m going to do a the Chinese versions,
video showing everyone
no matter how big and I’ve gone through a


what she’s done to it as the giant is few now. I had a couple
a follow-up video to my of small fires, and then I
original build. And if it got the textbooks out,
wasn’t open-source, and I learned about why
none of this would be happening. it went wrong and how to avoid it in the future. And
Everyone stands on the shoulders of giants, no that’s what I’m learning.
matter how big the giant is. We’re all just helping
each other up.
“I picked this phrase up from another YouTuber
once, I can’t remember who it was. But they said that
you should fail fast and fail cheap. Because so many
times you’re worried about starting something
because it’s gonna be wrong, or might cost you a lot.
But if you tell yourself, it’s OK to make a mistake, to
burn out your Arduino Uno when you connect the
power to the ground lead or something, and be
prepared to fail. That’s OK.
“I’ve got a pile of parts here for this weather bot.
Some of them are small mistakes, some are big
mistakes, but I could have modelled it in Fusion 360,
forever trying to polish out every little bit. But the
moment I start printing, that’s when things really start
happening – because you can see it, you assemble

23
www.dbooks.org
Meet The Maker

REGULAR

“I’d incorrectly estimated how much power the “Luckily, I was only in the room next door and I
LEDs on a project would use; I had a beefy power could smell it and I came in, but I used to leave stuff
supply. But, in the chain of power wiring, I’d bought testing overnight. I won’t do that anymore!
some little screw adapters so you get the wires from “Sometimes, I think it would be nice to know this
the power supply. One of those melted because stuff at the start of a project, to have the background
there was too much current going through it. I was a knowledge. If I could go back and talk to younger
bit annoyed, because I bought it with a 10 amp power Lewis, I’d tell me to go to university and study
supply – 12 volt,10 amp power, a super-beefy one. something in electrical mechanical engineering. You’ll
But it turns out, when I went to look up this particular


connector, it was only rated for one and a half amps,

Above
so it was a bit of a dodgy kit. I did warn my Patreons
I feel like I’m a bit late to
what happened when I found out what went wrong.
the game, but
Lewis’s builds use
precise 3D printed Be aware that if you buy these power bricks on
parts – such as this
Amazon with these little screw terminals – they’re
glowing geoleaf
implementation often not rated for as much as they should be. I don’t mind. I’m still


having fun

really enjoy yourself. And no, don’t worry about a job


afterwards. Just go in and, if you’re going to be
passionate about something, really immerse yourself
in it. Don’t jump halfway – just go for it and, like,
become an absolute geek in it.
“And then you’ll find something afterwards, just
because if you’re passionate, if you want to do
something for yourself, you’ll enjoy it.
“I feel like I’m a bit late to the game, but I don’t
mind. I’m still having fun.
“When I put the first video up, I didn’t know what
was going to happen. But people are really nice

24
SPARK

online. When we did the first video, my brother and I


Above
were expecting 20% bad stuff in comments, of This giant 7-segment
course, because the internet is a very open, free display/shelf unit is a
masterpiece of 3D
place, and people can be not so kind in their words. print and electronics
design
It’s not been like that at all. 99.8% of comments are
so kind or helpful or informative. Left
Resin printed chess
“The maker community seem very kind if you’re not piece – we think this
trying to pull a fast one on them. one is called a horsey

“And though it seems social, the idea of working on


YouTube or on social media – the truth is that you’re
at home. I’m in this little room on my own all day,
talking to a camera, then you’re editing, and you
might answer some comments and things.
“So, it’s not as social as it might seem. But
something magical happened – people send in
photographs. I’ve got a pinboard, just behind the
camera up here, where I pin the photos they send of
things that they’ve made.
“And they’ve written in with a picture – parents or
grandparents who’ve worked with their children on a
project. And they’re like, ‘We built this together, kept coming. So, I pin them up now because, when
we’re really grateful for having something we could you’re behind the camera and everything’s going
do as a family because the children learn coding at wrong, I just look at it and go, ‘People are watching
school now. And we just wanted to let you know how this and they’re building.’
much fun we had, and that we’re about to start this “I didn’t expect any of this to happen. I’m quite
project from you next.’ And I didn’t expect that. They surprised and amazed and really appreciative.”

25
www.dbooks.org
Letters

REGULAR

Letters ATTENTION
ALL MAKERS!
If you have something you’d
like to get off your chest (or
even throw a word of praise
in our direction) let us know at
hsmag.cc/hello

FAREWELL SANJAY
s e ent t ress e learned t e
assing an ay rtimer an ay ad
een ea ily in l ed in t e yist
rinting industry r as l ng as
t ere s een a yist rinting
industry s a under e
el ed reate t e t ends t at many
us use e eryday
ank y u an ay r el ing make
t e rinting rld a a ier la e
Our thoughts go out to all of his friends
and amily

FILM SCANNER
Well done to your writer [Anton Gutscher, How I Made , issue
digitised a l ad ld film it a film s anner e
made imsel r me t at s at en s ur e ard are is
all a ut finding a s luti n and fi ing it it ate er y u
a e t and e ause y u an remem er en
rinting first it t e eadlines a ut years ag e g t all
t ese st ries a ut e ll rint et a ks and li e in
rinted uses e reality is m re r sai t an t at
e rint at e need en e need it ut it s als
nder ul t at s mu uman reati ity as een
unleas ed t s a rilliant time t learn t rint

Marcus
New York

Ben says: Yes! It’s unrealistic to expect everyone to be able


to fabricate metal at home, or carve wood to any degree of
accuracy. But, a small 3D printer is accessible to anyone
with a bit of shelf-space. It’s a quiet revolution.

26
SPARK

STEREO PHOTOGRAPHY
ad t laug at t e stere t gra y tut rial y u
ran last issue e l est te ay r du ing a
stere t gra t at an t ink is t use t
ameras m unted a u le in es a art and t ere
it as n t e age ll y ur an y degrees and t e est
y u an me u it is t e a s lute asi s

Michaál
Belfast
DOCUMENTATION
ay e tend my ngratulati ns t nne Barela Meet the Ben says: In all fairness, the simple solutions are very
aker issue n retirement r m a seri us ent often the best ones. If mounting two cameras together
int a un at da ruit e ug t m nents and ards makes a perfectly cromulent 3D photo, so be it. But as I
r m t e likes da ruit im r ni and ark un and e recall, it didn’t end there: there’s all sorts of tricks you
ug t kn k s r m ina e m ney e sa ed n t e can pull with software, mirrors, and sliding brackets, so
un randed r du ts as alm st al ays een ar ar ut there’s plenty to get your teeth into.
eig ed y t e e tra time e s ent getting t em t rk
sear ing t e internet r instru ti ns t at d n t rk iring
t em u r ng t en a ing t uy ne e ause e g t t e
ltage r ng d n t aste my time n it s ust m re
e fi ient t uy stu it r er d umentati n s t ank ERRATA
y u nne r t e rk y u d making ir uit yt n r e ts ere as a small err r in t e
ust rk nline ersi n issue
ere y t e issue ad m st
Lee t e rig t ages in m stly t e
Northampton rig t rder is as n een
fi ed s i y u d nl aded it n
Ben says: Completely, 100% this. Time is, as they say, money. If day ne and are a ed y t e
you spend a couple of hours of frustration to save a few quid, is ay e e reinter reted age
that a good trade-off? num ers try it again n

27

www.dbooks.org
Crowdfunding now

REGULAR

CROWDFUNDING
NOW
Pixie Chroma
Light up your text in almost any colour

From $45 hsmag.cc/pixie Delivery: March 2022

I
t’s no secret that we’re big fans of LEDs text as easy as using serial.println() (yes, it’s an
here at HackSpace mag. They shine Arduino library). As well as letters and numbers, you
brightly and are perhaps the most flexible can show pre-defined characters – basically anything
user interface element. You can shine them that fits into the 5×7 matrix. As they’re RGB LEDs,
through things, on things, or just admire their you can display them in a wide range of colours, too.
bright, clear colours. Prices start at $45 for two Pixie Chromas (which
One of the very first uses for LEDs was the seven- can display four characters). While it isn’t the
segment display. This lets you display any number cheapest display around, it is one of the most
and a few letters using seven LEDs. There are a few striking looking.
adaptions on this style that add more segments –
thus letting you display a wider range of characters
– but it’s remained fundamentally unchanged for
decades. That is, until Lixie Labs came along.
The Pixie Chroma is the latest in a series of
display modules that have brought character displays
up to the 21st century. Each Pixie Chroma consists
of a two-character display, and each of these is a
5×7 matrix of SK6805 (NeoPixel compatible) LEDs
that can display a single character.
The real power behind this, though, isn’t that
there’s a bunch of RGB LEDs; it’s the software
behind it. While we haven’t tried it out, from the
documentation, it allows you to display a string of

28
BUYER
BEWARE !
When backing a crowdfunding
campaign, you are not purchasing
a finished product, but supporting
a project working on something
new. There is a very real chance
that the product will never ship
and you’ll lose your money. It’s
a great way to support projects
you like and get some cheap
hardware in the process, but if
you use it purely as a chance to
snag cheap stuff, you may find
that you get burned.

Left
Light up your letters
with little dots
of colour

29
www.dbooks.org
T H AT M A D E

OUT
“The Computers That Made Britain
is one of the best things I’ve read NOW
this year. It’s an incredible story of
eccentrics and oddballs, geniuses and
madmen, and one that will have you
pining for a future that could have been.
It’s utterly astonishing!”
- Stuart Turton, bestselling author
and journalist

Available on

Buy online: wfmag.cc/ctmb


LENS
HACK MAKE BUILD
Uncover the technology that’s powering the future
CREATE

PG

46
HOW I MADE:
LIGHT PAINTING
PG
32
The closest thing Gloucester
Cathedral has seen to magic since
Harry Potter was filmed there

PG

52
INTERVIEW: Add artificial intelligence
MATT STULTZ to your builds
Prusa Printers’ community
manager on the pandemic,
3D printing, and more

PG
PG
66
60
IMPROVISER’S TOOLBOX:
IN THE
WORKSHOP
WRAPPING-PAPER Join us as we create
Do something useful with this a unique Christmas
malleable, seasonal waste product PCB decoration

www.dbooks.org
Machine learning

FEATURE

Improve your builds with


artificial intelligence
By Rosie Hattersley

32
LENS

S
upermarkets you shop at but never
actually scan in anything and where you
don’t even get out your bank card to pay;
ticket barriers that open automatically
knowing who you are and that allow you
to pass through; apps that pop up on your
phone in anticipation of a purchase you’re
about to make; and keyless cars that just know it’s you
trying to get into the driver’s seat. Artificial intelligence
(AI) and data about the individual makes our digital lives
slicker and seemingly less complex than ever, but also gives
pause for thought about just how Alexa knew we were
planning to leave home imminently, prompting an unbidden
comment about the traffic or weather. Just as we’ve learned
to accommodate digital assistants and wearable fitness
trackers in our lives, so those very helpers have become
adept at anticipating our needs, our movements, perhaps
even our thoughts.
ML (Machine Learning) is at the heart of much of it.
It’s a catch-all term for a combination of technologies
and products that perform tasks that we humans would
previously have done, including a great deal of number-
crunching, analysis, and pattern-spotting that is now being
used in everything from fashion forecasting, stock market
speculation, and gambling to catching signs of serious
disease that would otherwise be overlooked. It’s also
allowing us to explore other worlds without necessarily
having a detailed idea of what we – or our electronic proxies
– might encounter.
Incredible processing power can be harnessed for good,
with trained computers using images and neural networks
to engage in deep learning, sorting through millions of pages
of data to spot trends or anomalies. But ML is now used
almost as much for everyday transactions and in our home
technology as it is in industry.
HackSpace looks at just how broad the uses for ML
have become, plus how to replicate some of these
examples yourself.

33
www.dbooks.org
Machine learning

FEATURE

HEALTH AND FITNESS


F
itness trackers log plenty of data about
the wearer, from how much cardio
or other fat-burning exercises they
undertook, to the restfulness of the
previous night’s sleep. Whether you’re a
Garmin, Strava, Apple Watch, Google Fit,
or Fitbit user, they all use data across apps
and devices to build up very detailed pictures of our daily
lives. AI uses information accrued by the fitness tracker
not only to remind us of our most recent achievements but
also to encourage us to do better today, and applaud us for
exercising efficiently and having all the right moves. Google
Coach uses motion capture to check whether we’re lifting
weights in line with instructions, while NadiX yoga pants
come with built-in sensors and an app containing guided
poses. Your smartphone camera recognises when you’re in
downward dog, and gives a helpful buzz to hint which bit of
your body needs to shift to achieve the correct shape.

DIY AI SELF-IMPROVEMENT
Since you almost certainly have a TV, a webcam, a
smartphone, and access to the tools involved in smart
exercising, you could follow the lead of other makers and
create your own fitness coach.
PoseNet is one of the tools in the TensorFlow
arsenal (tensorflow.org/lite) of ML apps that seek to it’s time to vacate the couch and get active. The user issues
Right understand human (and some animals') movements in commands such as start, stop, pause, and restart using the
Sensors embedded order to predict actions. Snips AIR voice assistant, while YogAI talks back through
into the NadiX
yoga pants buzz to Given its moniker, it’s no surprise to find PoseNet being the Flite voice synthesiser to guide the yogi to achieve the
indicate which part
of their body needs
used by yoga practitioners to help new converts accurately correct poses (hsmag.cc/SmartMirror).
to move to attain replicate moves. Cristina Maillo explains how she uses
the correct posture
TensorFlow and PoseNet (hsmag.cc/YogaMaillo) for STAYING FIT; EATING HEALTHILY
Below her YogAI yoga instructor, giving her the push to master You might eat healthily and exercise regularly, but are
TensorFlow and
pose predictions the moves first time. Fellow students at the University you capitalising on it all by eating the right foods at the
were used to create of Manchester suggested Cristina used the Coding Train right time to complement your fitness regime? Breath
YogAI – a pose
perfecting app ML playlist (hsmag.cc/CodingTrain) to learn yoga poses tests can be used to analyse how efficiently your body is
and then video herself metabolising what you put into it, and also decide whether
emulating them. PoseNet the next meal should primarily be carbs or protein-based.
analyses her posture and The Lumen breath analyser (and accompanying app) help
suggests improvements. you make informed choices, such as whether you need to
Another impressive use boost your energy levels with a banana before undertaking
of PoseNet sees the same a rigorous strength-training circuit, and the best time of the
YogAI concept incorporated day to load up on carbs. The personalised nutrition monitor
into a Raspberry Pi smart is quite needy, however, requiring sustained user readings
mirror where, presumably, three times a day, every day for optimal results.
schedules can be set up to Kutluhan Aktar proposes a less expensive, smart eating
remind the household that option: choosing healthy foods from the outset. His

34
LENS

barcode-based nutrient profile project were given 106GB of ‘raw intracranial’ MAT data as a
(hsmag.cc/BarcodeScanner) tackles the lack of agreed sample, and tasked with categorising it into preictal and
international standards for indicating how nutritious interictal states indicating brain readings just before and
foodstuffs may be. A combination of ML and a steadily between seizures. Data included ten-minute samples
Below
growing database of ingredients and already logged food for both humans and dogs. With the later introduction of A NeuroSky
labels that the device scans and then assigns a ‘nutri-score’ TensorFlow ML and convolutional neural network data MindWave Mobile
headset was used
helps makes the smart barcode scanner really useful. processing, the original findings have been used along with as part of the
Because of the TensorFlow neural network approach, items subsequent data to make 72% accurate seizure prediction
experiment
that are not logged in the system can be given a predicted predictions about imminent seizures
nutritional value score, helping users make more informed based on one million samples.
judgements about their food. The ECG readings can predict
an imminent attack,
DETECTING HEALTH ISSUES so the patient or
As well as checking what we’ve been ingesting, AI and data their carer can
analysis of our breath can be used in a non-invasive way take preventative
to predict medical emergencies that are imminent and the measures or simply
likelihood of diseases such as certain cancers. Research has prepare. Researchers
been ongoing for several decades, based on the premise used the readily available
that if our pets can detect their owners’ illness in their bad NeuroSky MindWave Mobile
breath, discernible clues must be able to be identified. A gas headset, generally used by
chromatography-mass spectrometer (GC-MS) can recognise gamers, and say that they are
volatile organic compounds in the air, among the hundreds “well convinced” of the benefits of
of which may include fragments suggesting cancer. investing time and effort into training
In 2018, with the aid of ML, Loughborough University’s and evaluating a model like this on more
data science team took on the onerous task of sifting data, using Raspberry Pi.
through the huge amounts of data provided from the
breath of cancer patients under the care of Edinburgh COLLECTIVE MONITORING
Cancer Centre, building up mathematical models based Mozzie Monitors (mozziemonitors.com), a citizen
around aldehydes, which frequently indicate stress or science initiative run by the University of South Australia
disease. Unlike humans, the ML approach is not subject in Adelaide beginning in 2018, discovered it was more
to accidentally missing critical information, running out of cost-effective to send out equipment to interested
steam, or error. As well as being cheaper and more reliable, members of the public to collect large amounts of data
the approach can be used for other types of illness and in on mosquitoes than to run a professional monitoring
different medical scenarios. programme. Researcher Larissa Braz Sousa told the
Loughborough University senior lecturer Dr Andrea science journal Nature (hsmag.cc/MozTrack) that “citizen
Soltoggio explained in the academic research journal scientists were able to collect a higher abundance of
The Conservation, “this intelligent software acquires mosquitoes than professional programmes in the same
knowledge and improves over time as it analyses more period, through a low-cost project from their backyards”.
samples (hsmag.cc/AIBreath). As a result, the method The volunteer programme cost roughly a fifth of a formal
is not restricted to any particular substance. Using this research endeavour with reporting via the free iNaturalist
technique, deep learning systems can be trained to detect app as well, as based on dedicated traps the researchers
small amounts of volatile compounds with potentially wide sent out to volunteers.
applications in medicine, forensics, environmental analysis,
and others.”
AI body measurements
AI ANALYSIS AT HOME Body measurement app Presize (presize.ai) uses the
Epilepsy-and-seizure-prone patients often suffer anxiety camera on your smartphone to generate a 3D image of
in the build up to an attack, and medication taken during your body shape, which it then stores and matches to the
one can have undesirable long-term side effects. A seizure correct clothing size when you shop at online stores that
have signed up to its service. The intention is to increase
prediction device (hsmag.cc/PredictSeizure) using a
customer confidence that they’re ordering the correct
gaming headset hopes to help. size, reducing shopping cart abandonment – only 2% of
The project, by Salma Mayorquin and Terry Rodriguez, browsing results in sales, its creators say, while 50% of
takes its cue from a 2014 Kaggle contest in which entrants clothes bought online are returned.

35
www.dbooks.org
Machine learning

FEATURE

HOME AI TECH

M
illions of homes now have voice then added a Raspberry Pi power bank and wireless
assistants such as Alexa and Siri, and connectivity, connecting to the thermal camera using
many are using Apple HomeKit or STEMMA QT cables for simplicity. He tried out several
Google Nest Hub to schedule lights, heatmapping options, including Matplotlib (which
heating, grocery orders, and other required a high baud rate but produced superior images)
electrical devices. Plenty of people also and OpenCV, which he settled on using, but importing
have video doorbells to provide reassurance Matplotlib’s superior colour maps and interpolation. Of
that Alexa and Google Assistant are AI-based. another option, OpenCV Web Server, Tom says: “If you
The AIY Kit costs £82 from The Pi Hut and Pimoroni, and have a screen for [Raspberry] Pi or you’re remoting into
lets you build these voice assistants into your DIY projects. it via Remote Desktop or VNC, this works fine. If you’re
walking around your house trying to use Remote Desktop
VISUALISE ENERGY LOSS AND PLUG THE GAPS on your phone to see the video output, [it] can be a pain.”
Thermal cameras became popular in the US as people He suggests playing around with different colour map
began to correlate high temperatures and Covid-19 settings to get levels of contrast that make problem areas
infections. The technology is useful for detecting hot spots easy to discern. Removing himself – an obvious source of
and heat loss, giving it an obvious application in offices heat – from an area being observed, massively affected
and houses. With winter looming, PiThermalCam maker the clarity of what’s shown, since the live colour map
Tom Shaffner set about detecting the parts of his home shows the relative temperatures of, say, the air in the
that were ineffectively insulated. He had Raspberry Pi room and the colder window panes.
hardware to hand, and Adafruit had helpfully launched Results-wise, Tom says the 110-degree camera angle
the £54 MLX90640 thermal imaging camera, making for sometimes proved unhelpful as it captured so much
a good-value build that would soon save him money and detail and averaged it out (he recommends the 55-degree
Above energy. He consulted existing thermal imaging camera version of the MLX90640 camera instead), but the project
Visualise
setup guides and an invaluable OpenCV guide to streaming overall was helpful in determining where the most critical
temperature with
this DIY build details via the web: hsmag.cc/OpenCVStream. Tom heat loss was occurring. As well as obvious culprits, such

36
LENS

as lounge curtains left open when the radiator underneath


was on, Tom confirmed large heat loss from a garage door
with windows and, less obviously, heating ducts above
the garage ceiling that lacked insulation, making heating
the apartment much less efficient and more expensive.
Lagging these and replacing the garage door came about
as a direct result of Tom’s AI vision project.

INTELLIGENT CLEANING OPTIONS


The rate of technological improvements since the first
commercially successful robot vacuum cleaner, the
iRobot Roomba in 2002, is also testament to the soaring from viewers who have been able to replicate these Above
Adding WiFi and
demand for domestic helper bots. These robot vacuum instructions for other models too. remote control via
cleaners can be expensive to maintain, but they can also an app transformed
an older robot
be made smarter by adding your own AI expertise to their WHO GOES THERE? vacuum model
existing electronics. Voice-activated devices have been eagerly adopted for
Below
the convenience of being able to ask questions about the Add motion sensing
to Raspberry Pi
GIVE A NOT-SO-SMART weather, travel, recipes, or request with a PIR sensor
ROBOT A SHARP UPGRADE songs or factual online searches,
When one Roomba owner but not without concerns relating to
realised his trusted robot vacuum privacy and speaker surveillance. If
cleaner was being outsmarted by This $5 upgrade you're already a little jumpy about
a rival brand’s more ‘intelligent’ whether your smart home devices
new model, he vowed not to be has earned are poised for verbal instructions
outdone. Instead, he studied the
new Neato Botvac robo cleaning
'legend!' plaudits to switch on the heating or lights,
this voice-activated intruder system
champ, worked out how to add (hsmag.cc/PiSpy) will not allay
AI to his own model, and then your fears. The Spy Audio Recorder
shared the details on The Hookup, project essentially bugs a room,
his hacking-focused YouTube channel: hsmag.cc/ listening in when it detects a conversation strike up, then
SmartBotVac. When his wife demanded, “Just transcribing what’s said and sending that information to
make the old one do the new stuff,” he declared it the project owner. Dreamed up as part of a light-hearted
challenge accepted. Element14 spy nerd challenge, the Raspberry Pi Zero W
Investigating the Roomba’s construction, he noted an project sees a mini USB microphone triggered by voices.
unused PS/2-type port, while online research revealed the Fun to follow along and perhaps prank your friends; it’s
robot cleaner’s schematics. He soon realised an ESP-01 perhaps a little too Big Brother for some people’s tastes.
WiFi upgrade would make for an easy upgrade and added
the return-to-charging-base, remote control, and scheduling
features the Roomba currently lacked. Using the robot
cleaner’s open interface, he was able to send the Roomba
500 new commands from his smartphone. An invaluable
Roomba Arduino web page (hsmag.cc/Roomba) provided
some of the Node-RED code needed to get the robot
to reveal its battery status and return to its charging
base when needed. A few tweaks to the information
the Roomba provided meant the smartphone controlling
it now showed battery percentage and whether it was
charging. Finally, weekly scheduling options, plus the ability
to automatically detect when someone is at home and
cancel the cleaning regime so that they aren’t disturbed,
transformed the robot into a far more useful device.
Robot vacuum cleaners can cost well over £1000, so it’s
unsurprising this $5 upgrade has earned “legend!” plaudits

37
www.dbooks.org
Machine learning

FEATURE

ENVIRONMENT

W
ildlife identification tracker BearID us listen to the dawn chorus in the forests of Borneo. As
is one of a number of identity-based well as being joyful in its own right, acoustic tracking is a
conservation endeavours that makes highly effective way to confirm the presence of species
use of Google image recognition tools, that may rarely (if ever) be seen, but whose existence is
highlighting the distinct facial features anticipated in a particular location.
and head profiles of brown bears. The
same technology recently caught our C-TURTLE LANDMINE-CLEARING ROBOT
Above
Machine learning
attention (hsmag.cc/ArtDouble), after Google suggested Some locations aren’t just tricky to access; they’re
can identify birds sharing photos of our pets online and automatically downright dangerous thanks to the prevalence of
from their song
identifying their art world doppelganger. landmines and hidden explosives. Arizona State University
Below PhD researchers decided to use ML to tackle some of
A cardboard, foil,
and Raspberry TRACK WHAT GOES WHERE the estimated eleven million landmines left behind in
Pi Zero robot AI and camera traps have transformed the possibilities former war zones, building a crawling robot they named
checks for hidden
landmines of wildlife monitoring in even the most remote locations. a C-Turtle (hsmag.cc/C-Turtle) due to its appearance and
AudioMoth acoustic how it mimics a hatchling's movements. The deliberately
monitoring was first cheap and simple design uses cardboard flippers to inch
created as a means of forward – the team ruled out using wheels – “they usually
identifying nocturnal have issues with slippage on sand, and they would create
species such as bats a more complex manufacturing process,” and uses a
and moths, but is now Raspberry Pi Zero. The team can send instructions to the
being used to record and C-Turtle, while the robot is able to process data onboard
relay soundscapes in and make decisions about which route to take based
the Doñana river delta in on the terrain it faces. Being able to perform simple
southern Spain, and to let data processing and ML directly on the robot was a

38
LENS

seizure (page 35), but the accuracy of the datasets


needs to be rigorously checked first. For his rice plants,
Jonathan noted that the MobileNetV2 pretrained model
he was using miscategorized some images on a white
background, but accuracy was improved to 80.1% when
the images were cropped and the amount of white
background ‘noise’ reduced.

ANALYSE YOUR OWN GREEN SHOOTS


With photos at its heart, it’s no surprise that computerised
requirement for using multiple robots in a fully autonomous visual identification quickly made its way to smartphones.
fleet, Kevin S. Luck, one of C-Turtle’s creators, explained. A number of apps use photo databases to help discern
plant, insect, and bird species – you’ve probably heard of
CLEANING UP OUR WORLD PictureThis, ChirpOMatic, and NatureID.
It’s no secret that our beaches and seas are clogged with There are also apps such as Planta that help you keep
plastic and non-biodegradable rubbish, but efforts to find plants healthy for longer by setting up a watering and
an intelligent way of cleaning it all up are proving elusive. maintenance routine and reminders for you to attend to
A number of PhD student projects can be found online them. Equivalents for farmers such as Plantix use the
detailing attempts to classify plastic bottles or discarded image comparison technique to spot problems with a
drinks cans, but a reliable litter categorization method has crop, then also suggest remedial action to help rescue
yet to make it to market. The laudable aims of projects such the plants. Rather than focusing on chemical pesticides,
as the LitterBug autonomous trash rover may, however, natural alternatives to spider mite infestations and other
form the basis of a future rubbish robot, which is one common afflictions, such as spraying on basil or rapeseed
reason why making such projects open-source and available oil, are suggested. The app has specifically been
to others is such a great approach (hsmag.cc/LitterBug). designed to help diagnose potential problems with staple
crops such as wheat, soybeans, bananas, and sweet
DIAGNOSING PLANT HEALTH corn, and for use in places where access to laboratory
Computer vision is ideal for comparing how something testing may be less practical. Above
The beach is a
looks at different stages of its life cycle. Visual clues can Should you prefer a DIY approach, keen AI inventor touch environment
also be used to detect problems. Electronics engineer Imetomi explains how to combine the joys of drone for a robot

Jonathan Pereira applied the concept to rice plants ownership with gardening in a fun plant observation Below
Checking on plant
(hsmag.cc/DiseaseID), noting that assessing “the process project that uses similar ML and image-comparison tools
health from the
of detecting and recognising diseased plants has always to those described above: hsmag.cc/GardeningDrone. skies
been a manual and tedious process that requires humans
to visually inspect the plant body, which may often lead to
an incorrect diagnosis”. Since crop diseases often spread
rapidly through entire species of cultivated plants, time
and accurate diagnosis are critical in preventing further
crop losses. Jonathan’s ‘transfer learning’ focuses on rice
plants – chosen due to its critical crop in large parts of Asia,
Africa, and South America – in which a dataset of images
is used to assess plants based on whether they have
healthy leaves and to alert researchers to diseased ones.
Rice plants work well for this proof of concept project,
since brown spot and leaf blast fungal diseases, as well as
the presence of pests, can be visually identified. The visual
database idea can be replicated for other plant species.
Transfer learning involved the ‘top’ layers of a
pretrained model being replaced with layers that can
learn the features that are specific to the training
dataset, making for a far more efficient setup, Jonathan
explains. A similar concept aimed at data efficiency
was used for the CNN created to warn of an imminent

39
www.dbooks.org
Machine learning

FEATURE

LEISURE TIME

A
rtificial intelligence (AI) isn’t just for tracker cannily knows you want to be able to show off
domestic chores, driverless travel, guitar skills, but you need a bit of a stick to encourage you
and agriculture: it’s great for gaming to continue (hsmag.cc/PracticeSeat).
too! Brainwave- and eye-movement- Based around an intelligent chair, the idea is you get
controlled gaming headsets, plus a DIY regular feedback on your axe playing, prompting you to
AI games controller, have their origins practice more and earn more praise. Needless to say, the
in technology developed for amputees idea can be used for other things you need, but there’s a
and wheelchair users. A mind-controlled means of playing lot to like about hacking a seat with an Arduino ESP8266
World of Warcraft was developed a decade ago
(hsmag.cc/MindWoW), while an Arduino-based option
that allows the user to operate Grand Theft Auto controls
resulted from keen gamer and NeuroSky controller hacker
Imetomi’s frustration at the limitations of games available
for the brainwave-driven headsets. Detailed instructions
Above can be found at hsmag.cc/GameThoughts.
Machine learning
to help human
learning BE AN AI GUITAR HERO
Right Quite a lot of AI involves allowing the app or device you
Machine learning want to use to nudge you to participate, leading to a
can keep an eye on
your cutting potentially busy Google Calendar. This guitar progress

40
LENS

MAKE YOUR OWN AI-GENERATED ART


Several apps for generating AI-based art provide an
introduction to getting creative with maths and neural
networking. One of the most successful AI artists so
far is Robbie Barrat (github.com/robbiebarrat), whose
GitHub details how to create generative art, such as the
reimagining of recognisable portraits and landscapes
by some of the world’s best-known artists, and even a
songwriting mash-up featuring Kanye West. Instructions
on using an Arduino and images of plants to create
abstract art can be found here: hsmag.cc/PlantArt.

Artwork
Immersive art, such as the Van Gogh Alive event in
London and New York, plus augmented imagery used to
impressive effect in shows such as Strictly Come Dancing,
Above
Human artists aren't going to be replaced just yet demonstrate the possibility of computer-generated AI
art that reacts to its audience. The LUMA projection
mapping show in NY in October (hsmag.cc/LUMAFestival)
that talks to another ESP8266 module to confirm how long
demonstrated just how far it’s come, asking event visitors
you’ve been sitting, hopefully practising some riffs, and to decide between the human- and AI-generated images
then generates an LED intimation of your awesomeness based on Edgar Allan Poe’s poem The Raven. Human
by way of affirmation. creativity narrowly won the vote – this time.
As maker Bob Clagett explains, other uses, such as
using the LED as a visual reminder to stand up, or using
the Arduinos to measure your time being quiet and
productive, are possible. Full instructions can be found at
github.com/iliketomakestuff.

AI PRECISION CUTTING
Crafting and cutting tools have proved popular additions to
many homes and makerspaces, and AI-based computer
vision seems like a sensible upgrade. The xTool M1 has a
16MP camera that uses computer vision and a powerful
laser to offer highly accurate cutting, and can be used on
a large range of materials, from aluminium and wood to
leather and thick card stock (hsmag.cc/xToolM1).

AI IMAGERY
Inveterate tech tinkerers 8BitsAndAByte think AI can
be rather too serious. Instead, they take an oddball
approach to applying AI with a caption-generating
camera that tells you what can be seen through
the shutter (hsmag.cc/TalkingAI). With the
addition of a Raspberry Pi Camera Module
Barbara, the talking AI camera captioner,
provides a fun introduction to how the image
recognition aspect of AI works.
If you’d like a means of sharing snaps and
video clips on TikTok, Instagram, and other Left
Who needs pictures
socials, there’s also a zany Instagram option:
when you can take
hsmag.cc/InstaAI. captions instead

www.dbooks.org
Machine learning

FEATURE

SMART TRAVEL

L
ow-profile autonomous delivery vehicles along with Eddie and the Hot Rods. An advantage of the
have been trawling the streets of Milton cloud approach is there’s little hardware tinkering to do,
Keynes, Greenwich, and elsewhere for and new apps, news feeds, and entertainment options
several years, while self-driving vehicles can be added as they come on stream.
that log road and terrain details as they
go (much like lidar-based robot vacuum RACE YOUR OWN FORMULA ROBO CAR
cleaners) are now starting to do the Roboracing combines real-life race cars with AI to form a
same. Elon Musk has been tweeting about the rapid road 200 mph hybrid racing car challenge that is just wrapping
layout learning abilities of his latest autonomous vehicles, up its beta series – the last chance for competitors to
while Wayve.ai announced back in 2018 that its second tweak their autonomously controlled racing cars before the
generation self-driving car was start of the racing season proper.
“teaching itself to drive” in just 20 Available to watch via Twitch.tv,
minutes: hsmag.cc/SelfTaughtCar. Roborace (see roborace.com)
This differs from the Waymo and Cars themselves offers an exciting insight into the
Google Aurora approaches because world of developing a car for both
there's no need for multiple have become driving and autonomous modes.
sensors and to have digested a The NVIDIA DRIVE platform is
detailed map in advance smarter used for self-driving mode, and
(hsmag.cc/WayveAICar). each car has onboard GPS, radar,
Cars themselves have become and lidar sensors and cameras.
smarter with the prevalence of Each team’s Devbot 2.0 all-electric
owner-accessible diagnostic tools that allow your car’s vehicle is the same for each team, but the AI driver
onboard computer to be hooked up to an Android device software can be tweaked to optimise its competitiveness.
or Raspberry Pi to see what’s happening under the hood.
Another option is to add car smart in the form of AutoPi AUTONOMOUS ADVENTURES
(hsmag.cc/Carputer), a ‘carputer’ that connects your car Self-driving cars and vans grab a lot of headlines, but there
Above or van to the great big cloud server where such delights are plenty of examples of autonomous vehicles of other
Wayve.ai car driving
around London as Adele’s unshuffled Spotify album vie for your attention sorts. Back in 2009, the University of British Columbia
LENS

began designing autonomous sailing boats and soon


started collecting trophies from the International Robotic
Sailing Regatta. In 2014, they began a new challenge
inspired by the Trans-Atlantic yacht race. Named Ada (after
Ada Lovelace), the 5.5 m autonomous yacht was designed SAIL YOUR OWN ROBOT BOAT Above
London's iconic red
and built by team members, propelled by a windsurfing Remote control boats and robots can be taught to avoid buses use human
rig (supplemented with solar panels), and was controlled obstacles and steer an efficient course, given the right drivers, for now

via Raspberry Pi. After setting off from Newfoundland for instructions. Coding and sailing enthusiast Wouter de Left
Compete for
Ireland, Ada completed 700 km of her 3000 km voyage Winter decided theoretical learning wasn’t enough, so he nautical glory at
before a heavy storm damaged her and took her offline. set up a two-day course in which participants with existing ai-captain.com
Miraculously recovered 200 km off the Florida coast programming knowledge compete against each other to
a year later, students used her wreckage to discover steer a real sailing boat and win a regatta. A YouTube clip
what had happened, and use their findings for the next at ai-captain.com shows the ship’s rudder being directly
UBC Sailbot, Raye, which is set for a few months’ time. controlled by the directions given by the computer, which
ubcsailbot.org/projects. has been trained by its student navigators.

Left
Add-on computers
can look a little
Heath Robinson,
but they do work

43
www.dbooks.org
SUBSCRIBE
TODAY
FOR JUST £10
Get three issues plus a
FREE Raspberry Pi Pico
delivered to your door
hsmag.cc/FreePico
UK offer only. Not in the UK?
Save money and get your
issue delivered straight to your
door at hsmag.cc/subscribe.
See page 66 for details.

Subscription will continue quarterly unless cancelled


SUBSCRIPTION

SUBSCRIBE
on app stores
From £2.29
Buy now: hsmag.cc/subscribe
Free Pico with print subscription only

hsmag.cc January 2022 Issue #50

VINYL RP2040
CUTTING The best dev
boards tested

SAVE
hsmag.cc
Customise your mug
December 2021 Issue #49 hsmag.cc November 2021 Issue #48

Compressed air FreeCAD Manage DIY


the mess

44%
Add elemental power
to your workshop
Model objects
from real life Tidy workshop,
tidy mind
Music
Adding long-range
D ESIGN radio to a project

YOUR FIRST

Make your circuits permanent


Power up your bricks Improve your builds with Turn your ideas into reality
with LEGO® Technic Hub TM

or Raspberry Pi artificial intelligence Learn


sewing
Add custom artwork
Control LEGO®
with Raspberry Pi
Make your own
Stereo cable bag

photography Dec. 2021


Issue #49 £6
Security DIY
Vacuum tubes
LIGHT CHRISTMAS
Issue #48 £6

Explore the magic Make your own Learn to use retro


Nov. 2021

of 3D images lock picking tools components

GLASS D A TPAINTING
A GRAFFITI L E D S P LIGHTS
ICO BUBBLE WRAP PLA
Jan. 2022

PURE Issue #50 £6

Take photography Control lots of LEDs


to the next level this festive season

WRAPPING 3D PRINTING PYTHON LATHES

www.dbooks.org
How I Made: Pilightpaint

FEATURE

By Didier Briand

PILIGHTPAINT
Light painting in high definition

46
LENS

What I used
> 3 × 125 LED
APA102-2020 strips
> Raspberry Pi Zero W
> 240×240, 1.3-inch
IPS LCD display HAT
for Raspberry Pi
> Matt black
i i pro e
and diffuser
> USB-C power bank
with Power Delivery
> Cables and
connectors


I
t’s magical!” is the comment
that most often comes up when
night-walkers come across me
during a light painting session.
At a time when the possibilities
of image manipulation seem
to be unlimited, light painting remains
a photographic technique that is rather
artisanal and yet fascinating. It is about
taking long exposures using different
light sources.
In this universe, a light painting stick is
like a programmable lightsaber; the idea is
to superimpose an image on a composition,
scanning the space, like a Jedi. The light
reflections contribute to the atmosphere of
the final result.
The photographer Michael Ross
popularised this technique. The genesis
of Pilightpaint is due to him. Indeed, the
rise of smart LEDs has expanded the
creative possibilities. HackSpace magazine
previously illustrated the concept of ‘writing
with light’ in issue 15.
However, the open-source projects
initiated by Adafruit, or the products
marketed for a few hundred dollars, still
have this effect of lines and pixelation linked
Above to too low a definition. I was convinced that
By carefully dialing I could do better for less… or, at least as
in the diffuser, I
avoided striping well, for the same price with the satisfaction
of controlling the whole process.

47
www.dbooks.org
How I Made: Pilightpaint

FEATURE

IN SEARCH OF Several components are 3D-printed


EDUCATIONAL PROJECTS to match the exact requirements: the
I am a teacher in STEM, and I am protective case, the fixing clips for cables
always looking for educational projects and accessories, the LED holders, and the
that combine creative aspects and profile joining elements. After testing old
technical knowledge. Light painting is a coloured filament spools I had in stock,
perfect example. I finally opted for a matt black PLA to
During a session, the students program a eliminate unwanted reflections. Finally,
strip of eight WS2812 LEDs; the objective the aluminium structure offers a good
is to produce a photo inspired by pixel art. compromise between rigidity and lightness,
I am amazed at the fascination that light despite the fact that the object takes up
can have on teenagers. If one can get the some space.
feeling that they are sometimes bored by
the effervescence of THE HARDWARE
technology, turning on The project requires three independent

“ SEVERAL an LED and controlling


its colour with a few
strips of 125 LEDs: type APA102-2020,
500 mm long, 3 mm wide. This type of LED

COMPONENTS
lines of code gives has the advantage of a better rendering
them real satisfaction. compared to the classic WS2812B. I
soldered the three modules end to end,

ARE 3D-PRINTED” A HIGH


DEFINITION STICK
taking care of SPI bus direction and having
removed the superfluous connectors
The Pilightpaint is the beforehand. Unlike an LED strip which is
improved version of flexible, the modules are made of a 1 mm
this activity! It consists thick PCB. So I ended up with an extremely
of a 375 LED RGB strip of the type APA102- fragile 1 m 50 long and 3 mm wide PCB.
2020 on 1 m 50, i.e. a resolution of 250 The LEDs are very close to each other –
LED/m. It is controlled by a Raspberry Pi my main concern was damaging the ones at
Below Zero W coupled with a 1.3-inch LCD screen. the ends when joining the strips. The copper
eflections in The power supply is provided by a battery layer is still fragile in this area where the
water can yield
excellent results that can deliver up to 3.6 A. soldering is to be done and the connectivity
was not assured during the first test. I
had to reshape and sacrifice two LEDs for
perfect signal continuity. Thus, the final
resolution of the Pilightpaint is 373 LEDs. I
still remember the special moment when all
the LEDs finally lit up!
In order to stiffen the whole and to better
control the light diffusion, I fixed the rod on
a matt black aluminium 15×15 mm profile.
Although I had opted for a wooden strip

48
LENS

Left
The diffuser (left)
smooths out the
light of the LEDs

in my first versions, my wish to obtain a


better quality product led me to this rather
restrictive solution… I had not properly
assessed the consequences of such
a decision!
As the saying goes, ‘Perfect is the enemy
of good’ – when you want to improve
something, you sometimes come up against
unexpected difficulties.
For reasons of availability and transport
costs, I chose 1 m long profiles that I had to
join rigidly after several attempts. Moreover,
it was no longer a question of simply gluing
the LEDs to the bottom of the profile. On
the one hand, aluminium is conductive; on
the other hand, I wanted to be able to adjust
the distance to the diffuser. So I modelled
in Fusion 360, and then printed about 15
brackets that form the interface between
the profile and the LEDs.

PROGRAMMING
Right The programming is handled by two
Images don’t have Python scripts: the first one manages the
to be complicated
to work well conversion of an image by transferring each
pixel to the stick with a defined frequency.
It is a fork of a program by Phillip Burgess
shared on the Adafruit website. The second
one controls the interface via an LCD display
and a five-input joystick. It is an evolution
that I wanted to make easier to use, and I
developed it entirely.
In my first version, the stick was
controlled by an Android application via
Bluetooth. I spent a lot of time solving
connectivity and pairing issues for the
Left Python scripts. I was using my smartphone
This image is not
photoshopped as a remote control to select files, set the
lighting time, or trigger. However,

49
www.dbooks.org
How I Made: Pilightpaint

FEATURE

adjusted the distance between the PCB


and the diffuser with the help of the printed
brackets to be at the limit of the overlap
between two consecutive LEDs.

FINAL DETAILS AND FINE TUNING


The pitch between two LEDs is only 4 mm,
and the casings are 2020 type, so I had to
leave 1 mm at the ends of the sticks before
soldering. Nevertheless, I had to re-adjust
a junction in order to correct a gap of
restricting the physical buttons was not only a few tenths too large that remained
Above
The closely-packed
very practical because I had to juggle perceptible in the shots. The idea is not
LEDs give great between my phone, the stick, and the to do things perfectly but well enough to
image quality
camera remote! make it work, so it is always difficult to
Waveshare offers several compact make the decision to remake with the risk of
interfaces for Raspberry Pi. A screen worsening a situation.
displays information, and a joystick with During the development, I had tested
buttons allows you to interact with the different display solutions. I first used a
Raspberry Pi. In addition to the above monochrome OLED display driven by I2C.
functions, the Pilightpaint offers a self- However, I was confronted with a lack of
timer, brightness management, directory reactivity. By using the SPI protocol for the
navigation, horizontal and vertical reversals, display, I improved the fluidity considerably,
or iterative advance for animations. but I could no longer use the LED strip
as it uses the same port! Fortunately, the
LET THERE BE LIGHT! Raspberry Pi Zero W offers a second SPI
The diffusion of light remains the essential port, but again it was using the same GPIO
point of this project; too pronounced, we as the function buttons of the LCD display
lose sharpness, not enough, and we will HAT! In the end, I had to adapt the interface
notice the trace left by each individual LED and control the stick using only the joystick.
during the shooting. I also opted for a 240×240 LCD screen,
So I selected a milky-white diffuser that which provides a good quality and colour
did not attenuate much, and I precisely display of the selected image files.
Potentially, the Pilightpaint’s power
consumption could reach 100 watts! During
the first tests, the voltage drop when lighting
the stick caused the Raspberry Pi Zero W to
reboot randomly. Fortunately, the program
limits the brightness to a more reasonable
value. One solution would have been to
separate the power supplies and dedicate a
battery to the Raspberry Pi Zero W, but this
was at the expense of weight. In the end, I
found a better-performing standalone battery
that delivers the power needed for the
Right
Keeping the unit lighting. In this phase of development, I also
portable and easy optimised the boot time to come back to a
to use is key to
great photos shorter time of about 20 seconds.

50
LENS

THE USE WHAT NEXT?


For a light painting session, I prepare image The expected cost is around €300, mainly
files according to the location. I generally due to the LEDs. It is lower than the
transfer them by FTP from my computer cost of a commercial product like the
to the Pilightpaint, even if I have kept the Pixelstick, while still meeting my needs.
possibility of using a USB flash drive or I’m considering developing a dismountable
Bluetooth. I try to visit the location during version because transport is not always very
the day to test the composition. practical and I would like to improve the
The idea is to play with the light and its interface. I’m also keeping an eye on the
reflections at twilight. I appreciate abstract evolution of smart LEDs.
figures as much as figurative images. The Pilightpaint opens up creative
Ironically, I can play with the pixelation of the possibilities that I have only scratched the
image and give it a flickering appearance. As surface of. You can find my creations on my
I often work in a humid atmosphere in order Instagram @mulholland77. Remember that
to deal with the reflections of water, I have only a few LEDs allows you to have a great
also improved the resistance to splashing. experience in light painting!
It is these subtle improvements that
contribute to the final result of the photos,
and I am always looking for ways to
improve. Many people think that the images
“ EVERYTHING
IS DONE IN
are photoshopped when, in fact, everything
is done in real time during the shooting. My
wish is that the technique fades away in
favour of a dreamlike composition.
REAL TIME”
Below
I’m still learning,
but really pleased
with the results
so far

51
www.dbooks.org

Matt Stultz


INTERVIEW

HackSpace magazine meets…

Matt Stultz
A true believer in 3D printing


S
ome people know as children
what they want to do when
they grow up; they do their
professional training, then
stay in that one niche until
they retire. Not so with Matt
Stultz. He’s been a writer, editor, maker
space founder, digital fabrication expert,
maker, and more (including a time spent
ensuring that McDonald’s fries made
it to every corner of America). He’s
now the community manager at
prusaprinters.org, and works on the
file sharing site set up recently as a
competitor/complement to the better-
known Thingiverse. He’s seen the good,
the bad, and the ugly of 3D printing, and
we loved hearing about it.

52

 
LENS


Credit: (c) Prusa Research - prusa3d.com

Above
Matt (seen here
on the left, with
ose ru a li es
and breathes
3D printing, not
so much for the
technology as for
what it can do for
humanity

53
www.dbooks.org

Matt Stultz


INTERVIEW

HackSpace You’ve been involved in the you’re into, you know, software The best thing about working for
maker community for a fair while, at development and hardware development, Thingiverse at that time was the people
Make Magazine, at MakerBot, and now at and you want to hang out with fun people that you met. I had already known Becky
Prusa. How did it all start? who want to make stuff, we’re going to Stern to some degree, and I already knew
start this thing. By early to mid-2009, we Matt Richardson – they were filming
Matt Stultz I started out as a software had formed HackPGH, which still runs to weekly podcasts for Make from within
developer. I was writing software [for] this very day. MakerBot at the time, so I’d see them
airline reservations; I’ve written software We were doing all the fun stuff, the more, you know – there’s plenty of people
for restaurant logistics, the biggest space balloons and playing around with within that organisation that have gone
being, for example, tracking how many the early MakerBot cup-cakes, you know, on to do all kinds of things. You learned
trucks of French fries McDonald’s had and other kinds of RepRap stuff, teaching so much because we were all so obsessed
going around the country. But I was Arduino classes. We started showing at with the maker thing; everyone who was
always interested in making stuff and Maker Faire Detroit; we went in 2011 and working there ate Arduinos for lunch,
doing stuff, and around that time, the showcased a load of our members’ right? It was part of their being.


maker world started to become And so you learnt so much
more accessible. about 3D printing, you learned so


So I started playing around with much about making things and
microcontrollers, and then By early to mid- software and microcontrollers
Arduino came out. It was so much 2009, we had and everything else. And so
easier, so much more cost- when I left Thingiverse, I left with
effective. Because you didn’t have
formed HackPGH, those relationships, and a lot of
to worry about expensive software which still the knowledge that came out [of
for some of the compilers; you runs to this that period].


didn’t have to worry about, you
very day But anyways, along the line, my
know, expensive dev boards and buddy Matt Griffin from MakerBot
programmers and everything else. got in touch about doing a big
And so I started playing around review of 3D printers for Make. I
with Arduino, and was really enjoying projects, including the Cheese Bot, which couldn’t do it the first year, but the second
it. But, you know, I had questions, and was a 3D printer that printed in cheese. year for the 3D printing shoot-out, they
there were things that I was trying to were able to get me on the team.
figure out. And so I started saying, like, HS Doesn’t that clog the nozzle?
hey, maybe what I should do is start an HS Was it just 3D printers you were
Arduino meetup group – you know, get MS In America, we have this cheese looking at?
together once a month, and talk about called Easy Cheese. It’s inside an
this thing. And in the back of my head, aerosol can. MS We were getting more and more
you know, I’m hearing about places affordable laser systems, CNC systems,
like NYC Resistor and Noisebridge out HS [Audible shock] everything else. Makers who now
in San Francisco, you know, all these understood 3D printing wanted these
hackerspaces getting kind of started. MS Anyway, I built a robotic gantry and other things too. So then we started
And so I thought, maybe one day if I start controlled it via an Arduino, and we bringing in everything from 3D printers
this Arduino meetup group, we can like, programmed it to write kids’ names on the whole way up to desktop water jets.
transition that into sometime becoming crackers. The beauty of that was that And after I did the digifab editing, I would
a hackerspace. even with a failed print, you’d have end up being in charge of all reviews.
And then I started hearing about this something to eat.
other guy who wanted to start a One of the big things that we were HS So working at MakerBot, Make, doing
community auto garage – sharing space doing at the time was playing around Maker Faires – that’s set you in good
and tools and things like that. And the with 3D printing technology. One of my stead for a community role at Prusa?
two of us sat down, and we basically were very good friends at the time was really
like, well, let’s just start a hackerspace, active in the cup-cake community, and MS I went over to Prusa and joined up as
let’s just do it. he was also an extremely talented a head of community role. That has taken
We put out a call to makers in the software developer. I got a call from some twists due to Covid, but initially the
Pittsburgh area and said, if you’re into the him asking me if I’d go and work plan was, let’s get people on board with
stuff that you see in Make Magazine, if on Thingiverse. Prusa Printers. We’re the new kid on the

54

 
LENS


Above
One way of explaining 3D
printers to people is that they
work like hot glue; unless you
happen to be in New York, where
nobody knows what hot glue is
according to att
Credit: (c) Prusa Research -
prusa3d.com

www.dbooks.org
55

Matt Stultz


INTERVIEW


Cr
ed
it:
(c)
Pr
us
a
Re
se
ar
ch
-p
ru
sa
3d
.c
om

Above
There s a lm on etfli called
Print the Legend, which Matt
recommends as a snapshot
of the early days of desktop
3D printing

56

 
block; how do we build more community
around Prusa Printers? One of my first
thoughts was about going back to
starting 3DPPVD, this monthly meetup
already a security system of badging into
the factory and stuff like that, but they
put in thermal cameras as well to check if
people were sick before they were
wasn’t something that the community
could easily contribute to, so they looked
into what would make a difference. A lot
LENS

couldn’t sell it, and they couldn’t ship it; it


around 3D printing. I had convinced two badging in. When all the face shield stuff of people were talking about masks, but
of my buddies, who were on the testing came up, they [Prusa] got deemed an that wasn’t something that could be done
team, to follow the same model, and they essential company and so could stay fast and easily with 3D printing. But face
had formed 3DPPH in Pittsburgh. open, and they really did take it to heart shields could.
I started going to maker spaces around that it was their responsibility to keep You had all of these people who were
the country and hosting Prusa meetups. people safe. They continued shipping putting their lives at risk; all these


I would email all of our customers that things not only to their customers, but doctors and nurses nothing the PPE that
were in the area and say hey, we’re also to people who were using these they needed. And so Prusa said, face
coming to town, let’s hang out. I’ll buy things for good. shields are something that you need; face
the pizzas, I’ll buy the beer, you guys I don’t want to toot our horns on this, shields are something we can easily
come, and let’s talk about 3D printing. It but we were sending out hundreds of make. So they started work on a design. It
was great! kilos of free filament to people making went through many different iterations,
Prusa, in my opinion, lives and dies face masks. The company itself produced constantly improving, until they got it
by its community. And not just Prusa; I hundreds of thousands of face masks certified for use by the Czech health
think we’ve seen this across the entire internally that they gave away to department. In the US we had situations
3D printing world. No one in where makers were trying to give


the desktop printing world can masks to hospitals and hospitals
survive without having a fan We quickly were refusing them because they
base, a community. We have the weren’t certified.
realised that
resources and the knowledge They churned out thousands
to embrace our community and we had all of the and thousands of these things, but
do more with our community. I equipment as is the case with all things
was going around trying to get needed to make Prusa, they also open-sourced it.


these meetups off the ground, We had tons of people
starting them up and then hand sanitizer downloading these face shield
finding someone to take it on files – it’s still one of our most
without me. I was doing that downloaded items on Prusa
quite happily, then the holidays rolled medical organisations in the Czech Printers. I produced almost a thousand of
around, and nobody was doing much Republic and other parts of Europe. It’s them right here in Maine.
over the holidays anyway. And then we important to talk about this stuff, but We took it a little bit further by using
started hearing about this virus that’s they didn’t do it for press; they did it the communities we’d built to do more. At
going around, and it became not a great because it was the right thing to do. that point we created this thing that we
idea to get a whole bunch of people in a They discovered that they had someone called Groups, making it easy to coalesce
room together. at work who had a background in cutting into communities with shared interests.
hair, so they set up a barbershop on the We saw a lot of people created Groups on
HS And then anybody who knew roof. That was such a quality of life thing Prusa Printers; I think they quickly
anything about 3D printing was making for the employees. They ended up buying migrated over to Discord and other
face shields. one of the Covid testing machines and servers for their main communication,
hired a nurse to do on-site Covid testing, but the nice thing was that it gave people
MS I think Prusa really jumped in very so all employees could go and get tested a place to go and look.
quickly on everything. The way that we whenever they wanted to at the factory.
handled Covid internally in the company Those guys really put effort and thought HS That is the hard thing about the
is a shining example to a lot of companies into keeping operations going, but also internet. A lot of the time you know the
on how to do things. We quickly realised keeping their employees safe. Was it the information is out there, but finding
that we had all of the equipment needed cheapest thing to do? No. Did we keep the it is impossible.
to make hand sanitizer, in a time when it factory open? Yes. It kept production
was almost impossible to get. Prusa went going the entire time. MS Beyond even information, it’s that
into production and was giving out free Early on they realised what they could hard thing about community and the
bottles to its employees. There was do with the hand sanitizer, but they internet. Finding people who have that

57
www.dbooks.org

Matt Stultz


INTERVIEW

same like-mindedness, and hopefully how many computers can you reach out you need them. Knowing you can go
finding people that you can jive with. and touch right now where you’re sitting? to Thingiverse, or go to Prusa Printers
The Prusa Printers community is great. Your phone, your laptop, however many and find the files for the things you need
Thingiverse is a behemoth. It’s the white Raspberry Pis are near you, and to fix.
whale. It’s like if Moby Dick had a everything else. I think that a lot of I see a site like Thingiverse as being at
love-child with a megalodon. It’s a tough people have similar doubts right now the same level of usefulness as Wikipedia
nut to crack, and we know that; we have about 3D printing, ‘why do I need a 3D is now. Wikipedia is this huge resource
no illusion that we’re going to replace printer in my home?’ But I think that is for being able to find all sorts of
Thingiverse in a week or a year. But we’re going to change. I think we saw that in knowledge. How often do you Google for
invested in it. And not only in trying to the 1950s with microwaves. ‘Why do I something and you’re just looking for the
supplant Thingiverse, but we’re more need a microwave when I already have an Wikipedia entry on it?
interested in making the tool that the oven?’ We all have microwaves now. As We haven’t really embraced the
community deserves. 3D printing technology gets better, it’s concept yet that everything we need in
I’m a true believer in all this stuff, it’s going to be adopted more. I also think the future is going to be a download and a


worth saying. I think 3D printing is that, much like computers needed that print away. Excluding some of the
changing the world, and it’s going to killer app of spreadsheets to make them electronics and things like that, but if I
change the world even more. I look at 3D useful, 3D printing needs that killer app. need a cup, or a measuring spoon, I can
printing technology in the same way as It might not be that there’s one just go download one. The global impact
computers and PCs. There was a time particular print that becomes the killer of these things is huge: we’re dealing
when people asked the question, ‘who app as much as having a repository of with climate change, we’re dealing with a
needs a computer in the home?’ And now, prints that you can search for when world where we have oceans full of

Right
Despite the
name, the
prusaprinters.org
site isn’t just for
owners of Prusa
printers. As Matt
says, “Prusa
Printers is an
awful name and
we know it!”

Credit: (c) Prusa Research - prusa3d.com

58

 
plastics, and a lot of people look at 3D
printing and think we’re just contributing
to the overall plastic waste.
But there’s a point where that could
We need to find ways for designers to
get the money and the attention they
need so we can build them up and they
can continue contributing to the
with someone else’s name on them?
Multiple, very slightly customised
versions of the same thing looks great on
numbers, but it’s also unwieldy.
LENS


change, very, very rapidly. We’re heading community; on the other hand, I think Thingiverse is the Hoover, or the Kleenex,
for the Christmas shopping season now, we’ve seen a rise in the Patreon of 3D print sites, just like MakerBot used
and there are tons of companies making designers and stuff like that. I love Cults, to be with 3D printers.
bets that their little stupid plastic toy I love MyMiniFactory, but we see a lot of It’s going to be a slog to overtake
is going to be the Furby of the year, that people who are taking their designs Thingiverse, but it’s an important battle.
it’s going to be the big hit. So many toys instantly to these sites. If you’re a A big reason I came to work with Prusa


at the end of this Christmas season will designer and you’ve made, say, a box that is that they get it. When I sat down
end up in landfills because they were not perfectly holds AA batteries, you might with Joe [Josef Průša], I was clear that
a success. think it’s really cool and sell it on if Prusa Printers was only there as a
What if we stopped buying the plastic MyMiniFactory for a couple of bucks. But money-making stream and they were
rubbish from Walmart and Tesco or you wouldn’t have been able to do going to figure out how to monetise it
wherever and instead, when we need that anything of that without the open-source in a year or two; I wasn’t interested.
plastic item, we make it. We just make community. There’s a happy medium to We had a big discussion about it and
the thing that we need, and the 50,000 be found; I’m just not sure where it is. We realised that we’re on the same page,
others that people don’t need don’t get need to support these people, and we also that Prusa Printers is one of the things
made in the first place. need to support the wider community. I that the community needs in order for
There’s a big opportunity for the still think sites like Prusa Printers and 3D printing to fulfil its potential in the
environment here, but we need sites like sites that are giving things away for free future. We’re going to make the best tool
Thingiverse and Prusa Printers because are important to the overall picture. that’s out there, and we’re going to keep
not everybody is a designer. Not everyone Because not everyone is going to want improving it.
can design a new coat hanger, for to pay $2 for the design for that box all The machine, the Prusa printer that
example; they need a place where they the time. And even though that box you buy today, is going to be a better
can go out and just get one. would probably cost more if you went to machine in a year than it is today, and
Walmart and bought the physical object, you can’t say that about most products on
when they think about the time they’re the market. That’s because they’re going
going to spend printing it and the cost of to keep updating firmware, they’re going
the filament, plus the cost of the design, to continue updating the slicing software,
in your head that might get too they’re going to keep pushing free
expensive. But if that design is free, it upgrades to you. Sure, there might be
triggers something else; the cost of the hardware upgrades, too, but just
material and cost of the time and energy software-wise, they’re going to continue
of printing it almost goes away. pushing
p ushing things
I still think that free access to forward, and
these designs is the thing that’s we’re doing the
going to bring in this punk rock, same with
Fugazi-esque idea of ‘make the Prusa
everything and do it yourself’. Printers site.

HS In order for a design


download site to be useful,
there’s got to be some guarantee
of quality, though, that, in
theory, the market should
provide. How do you stop
any site from being flooded
with rubbish?
Left
Prusa’s SL1 is
MS Exactly. How many key the company’s
rst oray into
chains does the world need resin printing

59
www.dbooks.org
Improviser’s Toolbox: Wrapping-paper

FEATURE

WRAPPING
PAPER
When it comes to giving, it’s the thought that counts but the
wrapping that remains. Rosie Hattersley offers some reuse options

W
hether you’re a Christmas fan, Decent quality wrapping-paper can, of course, be
a Christmas Grinch, or simply retained, smoothed out (gently ironed, if you must),
don’t celebrate the annual edges trimmed off, and used to wrap future presents.
festival of consumption, it’s fair Depending on the design, the pattern repeats may
to say there’s no avoiding the make for interesting festive decorations such as paper
sheer amount of Yule-related lanterns, while small pieces could be used as liners to
paper and pap around right now. In fact, the whole give a Yuletide feel to otherwise plain crockery.
industry relating to gifts and celebrations seems to Wrapping up gifts to disguise them has been a
generate an inordinate amount of stuff that is almost ‘thing’ for nearly 2500 years and, as with so many
instantly discarded. traditions, the Chinese and Japanese were early
Often, the wrapping that adorns thoughtfully adopters. In Japan, gifts are artfully wrapped in fabric,
chosen gifts is gossamer-thin and more ink than while printed paper wrap originates from the 2nd
pulp. Such examples are best reused for their vibrant century BCE Song dynasty, but was popularised in the
US in the second decade of the 20th century. It’s an

“Often, the wrapping that adorns


industry now worth $17 billion annually, with some
of the best-loved designs reissued as limited edition
thoughtfully chosen gifts is gossamer- classics and their originals preserved in museums:

thin and more ink than pulp” hsmag.cc/ClassicWrap.


As your last few weeks have probably attested,
the cost of wrapping-paper soon mounts up, in which
shades and kept well away from damp, but even case, as well as finding canny ways to reuse gift wrap
the cheapest sort of wrapping-paper can have a you’ve already got, you might want to print your own
worthwhile afterlife. In fact, the malleability of cheap next time, with help from the V&A’s handy guide:
gift wrap makes it perfect for papier mâché. hsmag.cc/WrappingPaper.

60
LENS

GIFT BOXES
G
et ahead in the present packaging create a box template: simply draw six squares in a Project Maker
stakes by using both used and offcuts long t, plus tabs to glue the pieces together. Cut out Thriftdiving
of unused wrapping-paper to clad the card template and make as many copies as you
Project Link
ordinary card or cardboard as festive, need to create multiple boxes. Place a card cutout over hsmag.cc/GiftBoxes
birthday, or other celebration-themed the area of wrapping-paper you want to use, if you
boxes. You could even cut up an old greetings-card want a particular section of the design to be prominent.
for this. The simplicity of this project, which involves If it’s an all-over pattern, you can simply glue the card
gluing and smoothing down your chosen wrap onto to the back of the paper. For a two-part gift box using
stiff card, makes it an ideal way to amuse the kids thicker paper stock, the video tutorial on
between Christmas and New Year too (or involve them thriftdiving.com provides great instructions, in which
in the gifting process at other times of the year). First, the paper is folded double to make it a bit sturdier.

Left
DIY christmas boxes
are a cheap way of
getting great-looking
presents

61
www.dbooks.org
Improviser’s Toolbox: Wrapping-paper

FEATURE

PAPIER MÂCHÉ
SCULPTURE

Right

S
Wrap paper and glue
around a balloon to
create a mask hredding wrapping-paper to pulp and water and glue to create a wet pulp. The classic
Below using for decorative crafts is one of way of sculpting is to use a form such as a bowl
Turn your Christmas
wrapping paper into a
the most obvious ways of reusing or a balloon that you pop once the papier mâché
festival sensation it. Unfortunately, being saturated with has dried out, as in this balloon lantern project
colourful dye makes hsmag.cc/BalloonLantern. Iconic Manchester
old gift wrap unsuitable figure Frank Sidebottom was made in exactly
for use as pet bedding, this way, as his creator Neil Donoghue explains:
but the bright shades hsmag.cc/FrankSidebottom.
really lend themselves For real impact, you could use rods, wheels,
to DIY lanterns and and other elements, especially if your sculpture
lampshades. In fact, is intended for public display and admiration.
the thinner and more Colombian artist Daniela Batalla’s Kilele Head
flexible the paper mascot, for the 2020 St Kitts Festival, uses a
the better when it combination of paper pulp, newspaper, glue, paint,
comes to applying it and improvised props to brilliant effect, as you can
as individual sheets, see, and was really taken to heart by festival-goers:
or mixing it with hsmag.cc/StKittsHead

62
LENS

FURNITURE
MAKEOVER
K
itsch home furnishing upcycling Project Maker
company Muck N Brass has some Muck n Brass
fantastic options for creating a
Project Link
visual impact using small amounts hsmag.cc/MuckNBrass
of wrapping-paper, wallpaper, paint,
and glue. The company’s maximalist approach to
making over dressers, wardrobes, and chairs often
involves wildlife designs, as seen in this YouTube Left
demonstration hsmag.cc/MuckNBrass, but can Do you love
Christmas enough to
equally be applied to wrapping adorned with festive have wrapping paper
scenes and celebratory themes. As well as incredibly on display all year?

careful image or pattern placement, hours are spent Below


We wrap gifts in
preparing the furniture to which paper is to be applied,
paper, why not
after which, lashings of protective lacquer is required. people?

WRAPPING- Project Maker


Avantgeek
Art

PAPER DRESS
Project Link
hsmag.cc/WrapDress

C
elebrating gift wrap in all its made from gift wrap, atones for having been remiss
kitschy, gaudy glory, AvantGeek’s about recycling and, instead, uses leftover rolls of
showstopping dress doesn’t just riff wrapping-paper for a more considered design. As
on the decadence of festive wrapping- she comments, the amazing creation has a fairly
paper designs, her highly original structural quality to it – so much so that, when left
garment is actually made from the very stuff unattended, the wrapping-paper dress doubles as a
her presents came in. A second version, also cat fort!

63
www.dbooks.org
Join us as we lift the lid
on video games

Visit wfmag.cc to learn more


www.dbooks.org
In the workshop: Christmas PCBs

FEATURE

IN THE
WORKSHOP:
Christmas PCBs
By Ben Everard Making artistic PCBs

C
hristmas means different things
to different people. Here in
HackSpace towers, it means an
excuse to play with LEDs. Lots of
LEDs. In the past, we’ve used
strings of addressable LEDs to
adorn Christmas trees and other decorations, but
this year, we decided to go a step further and get
some PCBs made to show off the LEDs.
It offered the opportunity to experiment with
different ways of driving LEDs, different types of
LEDs, and different PCB effects we can create to
make our PCBs artistic.
We decided on three PCBs, each
experimenting with a different thing:
• A bell-shaped PCB with a large area of
exposed copper to see how the shiny HASL
(silver-coloured coating) looks in big areas.
This has a single APA106 (through-hole
NeoPixel) as an LED.

• A star-shaped PCB with individual white LEDs


powered by a WS2811 chip (more on this
later). We also used this to experiment with
lines of silver HASL to reflect the light.

• A Christmas tree-shaped PCB with both


individual LEDs and APA106s. We wanted to
Right
This Christmas use this to experiment with artistic
flashes the component placement.
LEDs randomly on
and off

66
LENS

Right
s well as reflecting
light, traces also block
light shining through
the

Let’s start at the first one – the bell-shaped PCB. used the wrong sized footprint for the capacitors we
When making a PCB, it goes through different had. We did manage to get one PCB soldered up
stages to etch out the copper traces, drill holes, and and working, but the results weren’t good enough
add a (usually green) solder mask to protect the for us to pursue this further.
copper and make it easier to assemble. One of the At the risk of spoiling the ending, things got
final things is to dip the whole PCB in a vat of molten better from here.
solder and then blow off any excess, leaving just a Experiment number two was a star-shaped PCB.
thin film of solder stuck to any previously exposed You may well be familiar with WS2812B LEDs (aka
copper – this is known as hot air solder levelling NeoPixels) as we use these a lot in projects. They
(HASL). However, it’s not the only treatment option. let you control an

We’d try
The alternative is electroless nickel immersion gold almost limitless
(ENIG), which gives a gold-coloured finish to number of RGB
exposed copper – this is significantly more LEDs from a single

to use this
expensive and out of our budget for novelty PCBs. pin. You might
Given that the solder left behind by HASL reflects not know about
light, we thought we’d try to use this to make a WS2811 chips.
shiny PCB that would reflect the light around it. The
end result was disappointing. The HASL was soft
and scratched easily (unsurprising in hindsight since
This is basically the
same driver that’s
in a WS2812B
to make a
solder is mostly tin, which is a soft metal). Instead
of a shiny, smooth surface, we got an uneven matt
surface. To make matters worse, we accidentally
LED, but without
the LEDs attached.
Each WS2811 chip
shiny PCB
has three current-
limited outputs to which you can attach LEDs, as
well as a data in pin and a data out pin, which allow
you to chain the chips together.
To recreate a WS2812B, you simply need to
attach a red, green, and blue LED to each output in
turn, and you’ll be able to control them as you would
any other NeoPixel. However, each LED doesn’t
have to be red, green, or blue. They can simply be
three LEDs that you drive with 10 mA (the driving
current from WS2811). We used six white LEDs

67
www.dbooks.org
In the workshop: Christmas PCBs

FEATURE

(three sets of two in parallel) – these formed each


spur (with the pair being in the same place, but on
each side of the PCB). Driving LEDs in parallel like
Resistor crosses
this isn’t really recommended because you can get When playing with the resistor placement on this, I had a
few left over that I couldn’t easily find space for. There was
problems if the LEDs aren’t exactly the same, but
some open PCB, but I didn’t just want to fill it. I decided to
we were in the mood for experimentation, so why try making shapes with the resistors. After fiddling about
not try it? It’s worked well for us, but this is no with a few options, I created some crosses by placing one
guarantee that it will work well next time. resistor over the top of another. Is it a good idea? Does it
We used six WS2811 chips (three on each work visually? Honestly, I’m still not sure. It’s one of those
side of the PCB) for our six-pointed star. There’s things that’s so weird that you have to leave it for a little
while and then come back to it before you know how you
no microcontroller; this star is designed to be
really feel about it. What do you think?
driven by an external microcontroller (and includes
a data out pin from the last chip, so you can chain
them together).
The circuit for the WS2811 chips and LEDs came
straight out of the datasheet. It has a 1 K resistor
between the 5 V supply and VCC to prevent too
much power flowing into it, and a 0.1 uF capacitor
between VCC and GND on each chip to smooth the
power supply. A 1 K resistor between DOUT of one
chip and DIN of the next also help protect from any
excess currents.
It’s the first time I’ve used WS2811 chips, and I’m
pleased with how they worked. They provide a PWM
signal and current protection for the LEDs, so are

Right
These e posed
traces really add to
the look o
the decoration

68
LENS

hand and spent a long time making sure


everything lined up as we couldn’t use
the grid (which didn’t work with a six-
sided shape).
There’s a lot of exposed electrical
connections on this, which does
significantly increase the risk of
short-circuiting it if it comes into
contact with anything conductive. I
haven’t fully decided how to use these
PCBs yet, so might investigate using
something like conformal coating to
Right
t s all a bit make them safer when in use.
hapha ard, but Overall, I’m really pleased with
like the look o my
hristmas tree the star, and even more pleased to
have two new tricks in my armoury
for future projects: WS2811 chips
and exposed HASL for artistic effect.

GROWING A TREE
easier to use than port expanders The final project was probably the most ambitious.
or similar alternatives. They’re It really started because I was looking at the
available for just a few pence different effects you get with different types of LED
each, so are a cost-effective way and was wondering about combining them. In this
of controlling a lot of LEDs. case, diffuse 5 mm dome LEDs and small (0805)
You can drive the WS2811 chips using the usual
NeoPixel library in Arduino or CircuitPython. These
both refer to colours in their RGB form, but as long
as you realise that these are just channels driving
your LEDs, not actual colours, it’s easy enough to
use without modification.
I think the comparison of the bell and star PCBs
is a good illustration of how to use exposed HASL
for decoration effectively. On the bell, the large
area ended up looking scuffed and unpleasant.
However, the lots of little traces on the star give a
really pleasing effect. This does come with a couple
of caveats. Firstly, they’re an absolute pain to solder.
It turns out that solder mask does do a really good
job of ensuring solder stays where it’s supposed to
and doesn’t bridge connections. Removing it (we
removed it from the whole area) means you have
to be very careful when soldering. We could have
been a bit more judicious with our solder mask
design, but that brings us to the second problem – it
takes ages to create. We had to put this all in by
Left
Take a look
at the hristmas
tree animation at
hsmag cc mastree

69
www.dbooks.org
Improviser’s
In the workshop:
Toolbox:
Christmas
Paper plates
PCBs

FEATURE

The former option would make the LEDs stand


out more, but the latter would really let us celebrate
the electronics components that we know and love.
I went with a sort of hybrid approach in the end.
I used through-hole resistors and transistors, but
surface-mount capacitors. I attempted to place the
resistors to look like tinsel. The effect is helped a
little by the fact that I found some boxes of new
old-stock resistors in a ‘use me’ pile in Bristol
Hackspace. These older resistors are large, shiny,
Right
es, know the and look a bit more interesting than the usual ones
LEDs aren t lined up
per ectly, but was in
I get.
a rush, This PCB was the hardest to get working. Mostly
due to me being a bit of a fool. I designed all the
surface-mount LEDs. One thing led to another, and I PCBs in EasyEDA, which lets you search other
decided to make some Christmas trees with a people’s footprints. I found one for APA106 LEDs
Raspberry Pi Pico as the trunk and the components
artfully arranged. As well as the LEDs, I needed a
few additional components. There are some
capacitors to smooth the power supply, resistors to
limit the current to the LEDs, and a couple of
I attempted
transistors to allow me to control multiple LEDs
from a single GPIO pin. These days there are lots of to place the
resistors to
choices for the form-factor of components, but
really it came down to one thing: did I want to hide
the components away by choosing the smallest

look like tinsel


surface-mount components I could, or did I want to
celebrate them by going with larger, through-hole
components and placing them decoratively?

Right
hunky through
hole resistors are
o erkill, but we like
the look

70
LENS

BadgeLife
I took a lot of inspiration in this piece from the conference badge
movement. There’s a long-running practice of using decorative or
interesting PCBs as badges for electronics conferences –
particularly DEF CON, but also others. If you search for the
hashtag BadgeLife online, you’ll see a lot of examples.
more or less a physical form of what I had in my
The documentary called BadgeLife by Sophi Kravitz of
Hackaday is well worth a watch: hsmag.cc/BadgeLife.
head. Whether or not you like them will probably
The beauty of a Christmas decoration, rather than a very much depend on how you feel about PCBs and
conference badge, is that Christmas decorations are used every older-style components like dome LEDs and
year – they’re just added to each time. through-hole resistors. Personally, I really like them,
but they might be something of a niche taste.
The header at the top includes two GPIO outputs
to allow me to connect these up to other hardware.
I imagine this will probably be to use these as part
of longer rows of fairy lights, but I haven’t yet
(the through-hole NeoPixels) and used them decided. The two additional holes at the top are to
without checking fully that they were correct. They let me put strain relief on the power cables using
were not. They had power and ground flipped. I cable ties. I’ve not yet tested this.
made a few other changes, including allowing more Christmas obviously comes around every year,
space for the Raspberry Pi Pico, and switched the and like most households, we’re gradually building
footprints and waited for them to return. After up a stock of decorations. I’ve designed these PCBs
soldering, I realised that I had somehow managed to be expandable. On the Christmas tree, there are
to make the same mistake again. To this day I don’t two GPIOs exposed, and on the star, there’s Data
know how I managed to make this mistake twice. Out to allow you to chain multiple PCBs together.
I fixed it all on the third revision of the PCB and Where I’ll go with this next year, I’m not quite sure,
now have four fully working Christmas tree PCBs. but I’ve had great fun getting this far, so I’m sure
Again, I’m really pleased with the result – they’re there’ll be something.

Right
Large areas o
hot air solder
le elling are
ust a hassle

71
www.dbooks.org
3 ISSUES FOR £10
+
FREE BOOK

hsmag.cc/hsbook
ubs ribe to The ag i a pa e maga ine or ustom our first three issues for then our great value rolling subs ription
afterwards n ludes a free vou her for one of five fantasti boo s at store rpipress olle tions latest boo a ines
only ree delivery on everything
FORGE
HACK MAKE BUILD CREATE
Improve your skills, learn something new, or just have fun
tinkering – we hope you enjoy these hand-picked projects

PG

80
PARALLEL
NEOPIXELS
Power 26 chains of
NeoPixels in one go
PG
74
PG SCHOOL OF
82
SENSORS
Sniff out gases with a
MAKING
Start your journey to craftsmanship
Raspberry Pi with these essential skills

74 Pico Gearbox
PG

86
FREECAD
Ditch the 3D printer – learn
PG
to design for folded sheets
98
94
PG
TWINKLING
VINYL CUTTING
LIGHTS
Our favourite Christmas
Cut parts accurately and precisely lights code

www.dbooks.org
Pico-powered electric gearbox

SCHOOL OF MAKING

Pico-powered
electric gearbox
Running a lathe with a Raspberry Pi Pico

Dr Andrew Lewis

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

T
his project is about building a Thread cutting on a hobby lathe can be time-
gearbox for an old lathe that really consuming. Some lathes have a gearbox that lets you
should be retired from service. It’s a select a pitch from a range of common values, while
lathe that has some sentimental value, others use change gears that need to be replaced
Above
This lathe now has an and keeping it alive is not a whenever you want to cut a different pitch. Some
electric gearbox and a commercially sensible decision. During lathes can only cut right-handed threads, while others
variable speed spindle
motor, which makes a recent thread cutting operation, the lathe coughed, have a tumbler reverse for cutting left-handed threads.
the large, complicated
table on the front of
sputtered, and then fired a large steel gear out of the It’s not uncommon for the change gears to go missing
the machine entirely side of the machine, missing the owner’s head by a from a lathe, or for the gear change diagram to be
decorative. Without
these upgrades, couple of inches. Part of the gearbox had jammed, and so complicated that some people just can’t figure it
changing the feeds had damaged the rest of the box beyond all reasonable out. An electric gearbox does away with all of this
and speeds would
mean grabbing a chance of repair. What at first seemed like a disaster mechanical complexity, and lets the machine operator
spanner and a actually turned out to be a perfect chance for the select feed rates and directions with the push of
screwdriver to
recon gure the gears Raspberry Pi Pico to shine. a button.

74
FORGE

Left
This gear chain looks
OK, but the spindle
on the largest gear
is cracked. The gear
fle ing on the sha t
caused catastrophic
damage to the lathe

Below
3D-printed jigs
can really help
you increase your
accuracy when you’re
trying to get parts
into alignment. This
drilling jig locates
the mounting holes
for the motor relative
to the centre of the
hole for the original
sha t bushing

The problem with commercial electric gearboxes is 5 mm cork gasket to the front of the motor and slightly
that they’re pretty expensive. There are some oversizing the hole in the shaft at the lead-screw end,
open-source offerings, but they still have quite a then filling the gap with silicone, will give you some
significant cost associated with them because you wiggle room to align everything. The cork will also help
need quite a fast processor to work at the sort of to dampen any vibration noise from the motor.
speeds needed to monitor and control a lathe. Electric Your stepper motor and controller will need 24 V
gearboxes essentially replace the gears in a lathe with power, so it’s best to add a box to the side of the lathe YOU’LL NEED
a tachometer, a microcontroller, and an electric motor. to keep these components in. You can also take this
The tachometer measures the speed of the lathe opportunity to add an emergency stop to the box, and A Raspberry Pi
Pico
spindle, and the microcontroller calculates and sets reposition your motor controls if you’ve replaced the
how many rotations per minute the lead-screw should original spindle motor on the lathe. The Raspberry Pi 24 V PSU
turn to move the cross slide at a particular speed along Pico will need 5 V power, and the quickest way to DC-DC buck
the way of the lathe. supply it is to add a 5 V buck converter to the output of converter (5 V)
your 24 V PSU to get the necessary 5 V output. At this 6 × push-button
GETTING LATHEY point, you should have an optical encoder attached to switches,
You need to begin by removing the existing gears from (ideally vandal and
waterproof)
the lathe gearbox, and then removing any superfluous
gears from the head of the lathe. You need to create as 1024-bit optical
much free space as you can in the head of the lathe, industrial rotary
encoder
because you’ll be fitting an optical encoder and a large
stepper motor onto the side. How these parts will fit 2GT-400 timing
into the lathe will depend on the model you have. For belt
the common 9×20 class lathes, you can fit a 3D-printed DM556T motor
T2 pulley onto the spindle, and connect it to the controller
encoder with a toothed belt. The stepper motor can be NEMA 24 motor
connected directly in line with the lead-screw using a (4Nm 8wire)
steel rod, drilled at the ends to act as a coupling TXS0108E
between the motor shaft and the lead-screw end. It bidirectional level
can be tricky to line up the shafts exactly, but adding a shifter (or similar)

75
www.dbooks.org
Pico-powered electric gearbox

SCHOOL OF MAKING

signal and power cables are as far apart as is practical.


Ideally, shielded cable should be used, with the shield
connected to earth points on the case and lathe body.
The Raspberry Pi Pico is the heart of the gearbox,
and it does all of the necessary sampling and signalling
to keep the spindle and lead-screw working in sync,
while keeping the user informed via an I2C-connected
multiline display. Let’s look in more detail at what the
Pico is actually doing (the code is online at hsmag.cc/
issue50). The rotary encoder connected to the spindle
is generating a series of signals that are supposed to
indicate the direction and position of the encoder’s
shaft. It doesn’t really matter which direction the shaft
is moving in. We only really care about the speed that
the shaft is moving. Rotating the spindle 360 degrees
generates a total of 1024 pulses on both the A and B
the spindle of your lathe, a large stepper motor outputs of the encoder. The encoder uses two outputs
attached to the lead-screw, and a box with power to track the direction of the shaft. Because we only
supplies and a motor controller somewhere sitting off care about speed, we can use the Pico to count the
at the side, looking a bit lonely. Next, you’ll need to put pulses from just one of these outputs over a period,
together a control box with a display and some and use this to calculate the rpm of the spindle. To get
buttons, and connect all of the wires together using the best measurements we can, we will use the PIO
the circuit diagram. It’s helpful if you can make it easy feature of the Pico to count the pulses from the
to disconnect your wires from the control panel. A encoder. The PIO_COUNTER function does this by keeping
good solution is to use aviation connectors on the a tally of the pulses received in the X register, then
motor and the control lines, as they’re shielded and using a timer to push out the tally to the ISR after a set
have screw fittings to hold the plugs in place. It’s also amount of time. The timer also sets a flag true to let
wise to braid your motor cables to reduce the chance the main loop of the app know that the sampling period
of interference, and to route the cables so that the for the number of pulses has finished.

Above
The cork gasket is one
method of reducing
vibration and adding a
little bit o fle ion to
the drive system.
Getting direct drives
to align properly is a
challenge, and the old
adage about ‘make it
accurate or make it
adjustable’ is worth
paying attention to

Right
Cutting holes into a
metal cabinet can be
awkward. Using a
metal nibbler to cut
out the hole is fast and
easy, and it makes
very little mess

76
FORGE

Now that the Pico can count the number of pulses


per second, we need to do something useful with that
count. First, we want to convert the number of pulses
into a number that the user can understand, and
display it on the 1602 LCD.
The LCD is connected to the Pico on pins 0 and 1,
with power being provided from the VBUS pin.
Access to the display is provided by lcd_api.py and
pico_i2c_lcd.py, which you should install on your Pico
from hsmag.cc/PythonLCD. For more information on
how to install this, follow Les Pounder’s instructions at
hsmag.cc/LCDDisplayPico. Most I2C LCD modules
use the address 0×27, although with only one item on
the I2C bus, you don’t need to worry about this and
can simply use the command i2c.scan()[0] to find the
address of the first detected item. We calculate the
rpm of the shaft from the number of pulses per
sample period, and then display it to the LCD using the
lcd.putstr() command.
With a known rpm, we can calculate the speed that
the motor should be running at to create a thread of a
particular pitch, and get the stepper motor running at
that speed. To do that, we will use another one of the
Raspberry Pi Pico’s state machines to send instructions
to the stepper motor controller. The DM556T motor
controller used in this project is very similar to the
A4988 or DRV8825 controller that you find in a 3D
printer. While the A4988 is designed to handle smaller
motors like the NEMA 17, the DM556T can handle the
power requirements of more powerful motors like the 4A NEMA 24 used in this project. The inputs of the
DM556T are more flexible than those on the A4988,
accepting a range of voltages between 5–24 V on the
LEVEL SHIFTER three motor pulse, direction, and enable pins. The
The Raspberry Pi Pico uses 3.3 V, but most motor inputs also accept both positive and negative
connections for each input, which can be useful to filter Left
controllers like DM556T need a minimum of 5 V to 3D printing is a quick
function. You’ll need to use a level shifter to bump out electromagnetic interference caused by high-power way of making custom
that 3.3 V up to the required 5 V. The TXS0108E is a motors and other sources. gears
bidirectional level shifter that will take care of this You can use a very simple piece of PIO code to turn Above
for you, but you’ll need to take care with where you Industrial rotary
one of the Pico’s pins into a square wave generator. encoders are not the
position the module. The TXS0108E is designed for
logic-shifting signals between chips on the same board, One instruction will be used to turn the pin on, and one same as the small
encoders you use as a
and not for long runs of cable. For this project, it’s best instruction will turn the pin back off again. This regular jog or volume control.
to locate the chip close to the DM556T motor controller, pulse will be the signal sent to the motor controller to Industrial encoders
are normally optical or
so that the distance between the boosted signal and advance the shaft by one step. With the DM556T set magnetic rather than
the received signal is kept to a minimum. to microstep the motor at 1000 steps per revolution, mechanical, and
don’t usually
this will rotate the motor at 60 rpm when the state need debouncing

77
www.dbooks.org
Pico-powered electric gearbox

SCHOOL OF MAKING

Right
The housing has holes
for buttons and space
for a laser cut sheet

machine is started with a clock speed of 2kHz. The and although it’s not great practice to debounce
2kHz frequency might at first seem to be double the your switches in software by adding a delay, for this
number you’d expect, but you need to remember that application it’s not really a problem.
the state machine needs to execute two instructions to With the Pico loaded up with the example code, you
pulse the pin on and off, so you need to allow one should have all of the basic parts needed to get your
clock cycle per instruction. To get a minimum speed lathe carriage moving. Before you plug the power cable
lower than 60 rpm, you can add some extra nop() in, there are some settings you need to check over.
commands or tag some wait [1] commands to the First, measure the number of teeth per inch that your
end of each instruction, and allow for the extra lead-screw has. This value is critical for getting the right
instructions while calculating the target rpm, as shown pitch on any threads you cut, so get hold of a screw
in the setRPM function. gauge, and measure it properly. Most lead-screws are
You’ll need to connect some buttons to your imperial and measure in at 16TPI, but it’s possible
control box so that you can set the target rpm of the you’ve got a different TPI, or even a metric value
lead-screw, and perform various other functions like depending on your lathe. Check the value, and adjust
changing the direction of rotation or stopping the the shaftTPI variable to match it.
carriage. The Pico has built-in pull-up resistors, so you
won’t need to add resistors to your push-buttons, RIGHTY TIGHTY, LEFTY EXPLODEY
You’ll also need to adjust the DIP switch settings on
the DM556T to match your motor and stepping
HOW MANY WIRES? preferences. 1000 steps per revolution is a good place
The DM556T is designed to work with a four-wire to start, and it’s also wise to start out with the motor
bipolar stepper motor. However, you may find that your current set lower than your motor’s rated current. This
stepper motor has either six or eight wires connected. will help make sure that the motor doesn’t overheat or
QUICK TIP For a six-wire motor, you’ll just need to use four of the get damaged if something goes mechanically wrong. If
Power wires and wires and leave the ‘centre taps’ disconnected. For an
your motor stalls, you can always check for mechanical
control signals don’t eight-wire motor, you’ll connect the wires together so
that the coils are either connected in series or parallel.
reasons first and increase the current rating later. The
mix well. Route your
Wiring the coils in parallel will maintain torque at higher same principle applies to the motor’s holding current.
cables carefully,
speeds, while series wound motors will have a better One of the DIP switches reduces the holding current to
and use shielded,
twisted pair cables holding torque and less torque at high rpm. For this 50% of maximum. If you find this isn’t enough, flip the
to avoid interference project, the coils are probably better wired in parallel. switch – but keep an eye on the motor temperature
problems. until you’re sure nothing is going to overheat.

78
FORGE

Finally, raise the half-nut lever on the lathe carriage speed, and carefully engage the half-nut to interlock
so that the lead-screw and carriage move the carriage with the lead-screw. If all goes well, the
independently. Check the lathe is in a safe condition, carriage should start to move. If you find your motor Above
Make sure that you
and power it on at a low speed. Press one of the starts to skip, you might need to increase the motor get the right sort of
direction buttons on your power or change settings 1620 I2C display to


use with the
control panel, and the on the DM556T. Raspberry Pi Pico.
lead-screw should start to With a little work, you Some are 5 V only and
If the motor still isn’t might damage the
turn. Check that should be able to dial in Pico, some use 5 V
everything is turning moving, make sure the electric gearbox to power but 3.3 V logic,
and some are entirely
correctly, and the motor match the configuration
that the level shifter is 3.3 V. It’s not always


clear which sort of
isn’t making any strange of your lathe, and even display you have in
noises or obviously wired correctly add extra functionality to your hand unless you
have the original
slipping. If the motor rapid move the carriage or packaging with
doesn’t turn, check that monitor the direction of the description

the spindle rpms are higher than the minimum required the spindle. If you feel particularly ambitious, you could Below
to run the crossfeed (set at 30 rpm in the example add more CNC-like operations to the lathe with extra et the TL les and
code from hsmag.cc/
code, but can be changed by adjusting the square motors and DRO sensors. issue50
wave PIO to accommodate lower speeds). If the motor
still isn’t moving, make sure that the level shifter is
wired correctly, with the OE pin soldered to the 3.3 V
line, and that the pulse and direction pins are properly
connected. If you still can’t get the motor to run,
double-check the coil wirings (remember that an
eight-wire motor with parallel connections should have
the opposite coils wired with reverse polarity, or the
two coils will cancel each other out) and make sure
you’ve got a pulse signal coming from the Pico using
an oscilloscope if you can. Once you’re happy that the
motor is working as expected in both directions,
increase the spindle speed and check that the
lead-screw still looks stable. Finally, reduce the spindle

79
www.dbooks.org
All the LEDs

TUTORIAL

All the LEDs


Power up to 26 strips of NeoPixels
from a single Raspberry Pi Pico

W
S2812B LEDs – sometimes machines. Pico has eight state machines available,
known as NeoPixels – are a so you can send data to NeoPixels from eight GPIO
great way of adding colour to pins. This is a bit better than just one, but what if we
your project. They’re chainable want to blaze all the lights. We have 26 GPIO pins;
RGB LEDs, which means that why can’t we connect a NeoPixel to each one?
you can connect lots of them Well, we can! Graham Sanderson – one of the
Ben Everard to a single GPIO pin on a microcontroller. If you’re team of software engineers working on the PicoSDK
adding a few tens of LEDs, this works really well. – created a PIO program that can control strings of
@ben_everard
However, if you try to chain together too many, you NeoPixels. We have adapted it slightly to make it
get a few problems, including slow updates and easier to understand. If you just want to make LEDs
Ben's house is slowly
being taken over by 3D the potential for one broken LED to stop your entire flash, you can grab the code using this link:
printers. He plans to project working. hsmag.cc/PicoParallel.
solve this by printing an
However, even if you have spare GPIO pins, The PIO program is deceptively simple:
extension, once he gets
enough printers. it’s not always possible to connect NeoPixels to
.wrap_target
additional GPIO pins. These LEDs speak a slightly
out x, 32
unusual protocol, and it can be resource-intensive to
mov pins, !null [T1-1]
send data out.
mov pins, x [T2-1]
Fortunately, Pico has a trick up its sleeve. Its
mov pins, null [T3-2]
Programmable IO (PIO) lets you create state
Above .wrap
NeoPixel strips are machines that can send data to external devices
probably the most using almost any protocol with very little CPU The protocol is basically a continuous series of
common form of
addressable LEDs overhead. You can send data to NeoPixels using state pulses. A short high followed by a longer low is a

80
FORGE

digital 0, while a long high followed by a short 0 is a location to another – in our case, the pixels array to
logical 1. the PIO’s transmit state machine.
It reads in 32 bits of data and then sends them There’s a bit of code to set this up (and make sure
to the GPIO pins. Each 32-bit word of data we send the relevant interrupts are firing), but the main code to
to this PIO program contains 1 bit of data for each keep it running is:
of the chains of NeoPixels. Data is handled in 32-bit
int64_t dma_start() {
registers, so it’s not possible to make this an arbitrary
dma_channel_set_read_addr(dma_chan,
number. It’s possible to set it to be some factor of
pixels, true);
32 (such as 16), but this will affect the way data
return 0;
is stored.
}
The main code has to now create and manage a
structure that can be used to send data in this form.
void dma_handler() {
uint32_t pixels[NUM_PIXELS*24]; dma_irqn_acknowledge_channel(DMA_
IRQ_0,dma_chan);
uint32_t set_pixel_colour(int pixel, int channel,
uint8_t r, uint8_t g, uint8_t b) { add_alarm_in_us(RESET_TIME_US, dma_start,
uint32_t colour_value = (b << 16 | r << 8 | g); NULL, false);
}
for(int i=0; i<24;i++) {
Each time it gets to the end of the array, the
if (colour_value & (1u<<i)) {
DMA system raises an interrupt which is caught by
pixels[(pixel*24) + i] |= 1u <<
dma_handler (see the main code to see how this is set
(channel);
up). We need to pause for 400 microseconds to reset
}
the LED strip before sending more data. You can’t use
else {
sleep in interrupt handlers (or the program will crash),
pixels[(pixel*24) + i]
so we use an alarm to call another function at the
&= ~(1u<<channel);
appropriate time. The second function (dma_start())
}
just kicks off the DMA transfer again. These two
functions will just keep shuffling the latest data out to
}
the LEDs with almost no CPU resources used.
}
In the main loop, you can set the pixels to be
Here, we have a global variable called pixels that is whatever colour you want, and this DMA/PIO system
an array 24 times the number of pixels (each pixel has will update the LEDs as soon as possible.
24 bits of data – eight each for red, green, and blue). This is an incredibly powerful way of controlling
To set the colour value in this array, you have to large numbers of LEDs in a way that’s quick and has
loop through all 24 bits of the colour, and use bit- some redundancy should the hardware in a single
masks to set the right bit in each 32-bit value. This is LED fail.
done using either:

pixels[(pixel*24) + i] |= 1u << (channel);

…to set a bit high while leaving the other 31 bits


unchanged, or

pixels[(pixel*24) + i] &= ~(1u<<channel);

…to set it low.


The |= and &= are used to OR or AND (respectively)
the left-hand value with the right-hand value to apply
the mask.
We need to fire out a lot of data. We could use the Left
CPU to load data into the PIO state machine, but it Each strip needs a
connection to 5 V,
would take a lot of the CPU’s time, and we can free ground, and a signal
this up by using Direct Memory Access (DMA). This line. To connect more
strips, add a signal line
is an off-CPU system that will shuttle data from one to an adjacent pin

81
www.dbooks.org
Sensory world: Build a fire and gas leak alarm system

TUTORIAL

Sensory world:
Part 01

Build a fire
and gas leak
alarm system
Enable Raspberry Pi to detect flames and gas leaks to raise an alarm

H
Connect flame sensor
umans experience the world through a
range of senses. This enables us to be aware
01 For this tutorial, we’re using the
of whatever’s happening in our environment flame sensor from the Waveshare Sensors
so that we can react to it. Pack, available in the UK from The Pi Hut
So, it makes sense (no pun intended) that your (magpi.cc/wavesensors), and also sold separately,
Phil King
MAKER

Raspberry Pi would also benefit from being able to but any similar sensor should work in a similar
sense things. Fortunately, this is made possible way. It uses PIR (passive infrared) to detect a
Longtime
contributor to The using a wide variety of electronic sensors. In this change in temperature nearby. While the sensor
MagPi, Phil is a series, we’ll explore some of the most commonly has pins for both analogue and digital outputs,
freelance writer and
available sensors and their use cases. we only need the latter for our alarm, as a nearby
editor with a focus
on technology. To start off, we’ll build a simple fire and gas leak flame will set the digital output to high.
alarm system using a couple of sensors. When With the power turned off, connect the flame
@philkingeditor
either hazard is detected, a visual and audible alert sensor to Raspberry Pi, as in Figure 1 (where it’s
will be triggered. at the bottom). We’re powering it from Raspberry
Pi’s 3V3 pin, grounding it with a GND pin (both via
the breadboard side rails), and the digital output
Figure 1 The wiring diagram for the complete alarm system,
Figure 1 including two sensors, LED, and buzzer (marked DOUT on the sensor) is going to GPIO 21.

Flame test code


02 With the flame sensor wired up, turn on
Raspberry Pi. You should see the sensor’s red
power LED light up if it’s connected correctly.
To start with, we’ll create a simple Python
program, as in the flame_test.py listing, to
read the sensor and print out a message when
triggered, to check that it’s working correctly.
From the desktop menu, go to Programming and
open the Thonny IDE to start coding.
To simplify the setup, we’re using the GPIO
Zero library rather than RPi.GPIO; at the top of

82
FORGE

The MQ-5 gas sensor can detect


butane, methane, propane, and
other noxious gases

The passive infrared flame DOWNLOAD


sensor detects any nearby
fire within its scope
THE FULL CODE:
magpi.cc/github

our code, we import the Button method from it.


We’ll use this to sense when the digital output
from the sensor is high, in effect the equivalent
flame_test.py Top Tip
of a push-button being pressed. As it’s connected
Analogue out
to GPIO 21, we assign the flame object to this with > Language: Python
flame = Button(21). For simplicity,
In an infinite while True: loop, we check 001. from gpiozero import Button we’ve used the
whether the pin is high (if flame.value == 1) 002. digital outputs
and set the message (msg1 variable) that we’ll be 003. flame = Button(21) to trigger our
alarm. To use the
printing to the Thonny Shell area accordingly. 004. msg1 = ""
analogue outputs,
In our print statement, we add the end = "\r" 005.
you’ll need to
parameter so that the message is always printed 006. while True: add an ADC chip
on the same line, which is a lot neater than using 007. if flame.value == 1: (e.g. MCP3008) to
a new line each time. 008. msg1 = "Fire! " convert them to
009. else: digital readings.
010. msg1 = "No fire"
011. print(msg1, end = "\r")
Flame on!
03 Now it’s time to test our sensor by putting
You’ll Need
a flame near to it to see if it triggers our alarm > Flame sensor
Add a gas sensor
message. We used a disposable lighter for this, but
you could just light a match. Always be careful with
04 So, we have our flame sensor working
magpi.cc/
flamesensor
fire, though, and don’t get the flame right next to correctly. Now it’s time to add the gas sensor to > MQ-5 gas sensor
the sensor as it’s not fire-proof! our setup. We’re using a Waveshare MQ-5 sensor magpi.cc/
Run your flame_test.py Python code and then for this, as featured in the Sensors Pack, but other gassensor
move the flame towards the sensor. Ours triggered similar gas sensors are available. The tin oxide > LED
at around 30 cm distance, but the sensitivity can be layer inside the sensor has a high sensitivity to
> Active piezo buzzer
altered by using a small crosshead screwdriver to the presence of gases such as butane, methane,
adjust the screw on the sensor board – other flame and propane. > Jumper wires
sensors may have a potentiometer rotary knob on The sensor has pins for analogue and digital
board for this purpose. outputs, but we only need the digital output for
When the flame is close enough to trigger the our alarm. We connect that pin (DOUT) to GPIO14,
sensor, another red LED lights on ours to indicate and the VCC and GNC pins to 3V3 and GND (shared
this. The message printed in the Thonny Shell area with the flame sensor via the breadboard side
should change from ‘No fire’ to ‘Fire!’. rails), as in Figure 1 (gas sensor at the top).

83
www.dbooks.org
Sensory world: Build a fire and gas leak alarm system

TUTORIAL

gas.value == 1), then the message will be set to


‘Gas leak!’; if not, it’ll be ‘No gas’.
We add msg2 to our print statement, after msg1,
again including the parameter end = "\r" so the
message is always printed on the same line.

Turn on the gas


06 Now it’s time to test our gas sensor to
check it’s wired up and working correctly. As
before, we’re using a disposable lighter for this,
pressing the button to release a little gas without
Testing the flame
igniting it for the flame. You could use gas from a

flame_gas_test.py
sensor with a lighter.
Be careful not to move hob or cylinder, but you only need a tiny amount
it too near the sensor
or other components! to trigger the sensor, so be sure to turn it off again
after a couple of seconds.
> Language: Python Run your flame_gas_test.py Python code

Top Tip 001. from gpiozero import Button


and then release a little gas in the vicinity of
the sensor. As with the flame sensor, the gas
002. sensor’s sensitivity can be altered by using a small
Off board 003. flame = Button(21) crosshead screwdriver to adjust the potentiometer
004. gas = Button(14) screw on the sensor board.
We’ve placed our
005. msg1 = "" When the presence of gas is detected and the
sensors on the
breadboard, but 006. msg2 = "" sensor is trigger, another red LED lights on ours to
you could keep 007. indicate this. The second message printed in the
them separate 008. while True: Thonny Shell area should change from ‘No gas’ to
from the other 009. if flame.value == 1: ‘Gas leak!’.
components and 010. msg1 = "Fire! "
wire them up from
there, with the
011. else: The gas sensor’s sensitivity
012. msg1 = "No fire "
digital outputs
wired directly to 013. if gas.value == 1: can be altered
the GPIO pins. 014. msg2 = "Gas leak!"
015. else: Let there be light
016. msg2 = "No gas "
07 If your sensors and code are working
017. print(msg1, msg2, end = "\r") correctly, and the correct messages are shown
when they’re triggered, it’s time to move on to
the next part. Printed messages are all very well,
Add gas to code
05 While we could create a new program to
but for a proper alarm you need a visual and/or
audible alert.
test the gas sensor separately, we’ll add it in to our For the visual side, we’ll add a standard red
previous code as it will then be simpler to rework it LED to our setup – ours is 5 mm, but you can use
into our final alarm code later. any size. As always when using LEDs, a resistor
In the flame_gas_test.py listing, we assign the is required to limit the current to make sure it
gas object to GPIO 18 with gas = Button(14). As doesn’t receive too much and potentially burn out.
before, we’re using the Button method to detect With the LED placed in the breadboard, with legs
when the pin is triggered and thus set to high. in different unconnected rows, we connect a 330 Ω
We add a new msg2 variable, which we’ll set to resistor between the negative (shorter) leg and the
the message we want to print in the Shell area. ground rail of the breadboard. The positive (bent,
This is done by adding some extra lines to our while longer) leg is connected to GPIO 16 on Raspberry Pi
True: loop. If the gas sensor pin is triggered (if (as in the Figure 1 wiring diagram).

84
FORGE

The Waveshare flame sensor has both analogue and digital


outputs. Sensitivity can be adjusted with the screw The MQ-5 gas sensor can detect several noxious gases in the air
and is highly sensitive

Get a buzz
08 For our audible alert, we’re using a small buzzer (e.g. magpi.cc/towerlight). You could also
active piezo buzzer to make a beeping noise. The send an email or push notification alert to your
buzzer will have a longer positive leg and a shorter phone whenever the alarm is triggered.
negative one; their positions may also be marked Next time we’ll create an intruder alarm using
on top of the buzzer itself. Connect the negative noise and laser sensors. See you then.
pin to the breadboard’s ground rail and the Warning!
positive pin to GPIO 25 (as in Figure 1). Fire and gas

fire_gas_alarm.py Never play with fire! Be


careful when testing
your alarm and don’t

Alarm code position the lighter flame


09 With everything wired up as per Figure 1, > Language: Python
too close to the sensors
or other components.
Only release a small
you’re now ready to program your fire and gas amount of gas and do
it in a well-ventilated
alarm. In the final code, fire_gas_alarm.py, we 001. from gpiozero import Button, LED, Buzzer area. Do not rely on
add LED and Buzzer to the gpiozero imports at the 002. from time import sleep this DIY alarm for your
safety. In the event
top. We also import sleep from the time library, to 003. of a real fire or gas
use as a delay. 004. flame = Button(21) leak, call the relevant
emergency service.
We create two functions, one for each type of 005. gas = Button(14)
magpi.cc/firesafety
alarm: fire_alarm and gas_alarm. Each uses a for 006. led = LED(16) magpi.cc/gassafety
loop which toggles the LED and buzzer on and 007. buzzer = Buzzer(25)
off a set number of times, with a 0.5 sleep delay 008.
each time. 009. def fire_alarm():
Finally, in a while True: loop, we check the pin 010. print("Fire! ", end = "\r")
THE MAGPI
values and trigger the relevant alarm when the 011. for i in range (10):
pin receives a signal from the sensor. If neither 012. led.toggle()
is triggered, we show the default message and 013. buzzer.toggle()
ensure the LED and buzzer are turned off. 014. sleep(0.5)
015.
016. def gas_alarm():
017. print("Gas leak!", end = "\r")
Sound the alarm 018. for i in range (10):
10 Now to test the alarm system. As before, try 019. led.toggle()
This tutorial
positioning a flame near the fire sensor to check 020. buzzer.toggle() is from in The
that the alarm is triggered, in which case the LED 021. sleep(0.5) MagPi, the official
will blink and the buzzer will beep. Do the same 022. Raspberry Pi
for the gas sensor by releasing a small amount 023. while True: magazine. Each
of gas; the alarm will sound again. Each time, an 024. if flame.value == 1: issue includes a
huge variety of
appropriate message will show in the Shell area. 025. fire_alarm()
projects, tutorials,
026. elif gas.value == 1:
tips and tricks to
027. gas_alarm() help you get the
028. else: most out of your
Taking it further 029. print ("All OK ", end = "\r") Raspberry Pi.
We now have a simple working fire and gas alarm. 030. led.off() Find out more at
To make the alert more obvious, you could add 031. buzzer.off() magpi.cc
a relay switch to turn on a 12 V tower light with

85
www.dbooks.org
Sheet folding in FreeCAD

TUTORIAL

Sheet folding in FreeCAD


Let’s look at an amazing workbench that makes working with sheet metals,
or other foldable sheet materials, simple to CAD

Jo Hinchliffe
@concreted0g

Jo Hinchliffe is a
constant tinkerer and
is passionate about all
things DIY. He loves
designing and scratch-
building both model and
high-power rockets, and
releases the designs and
components as open-

I
source. He also has a
shed full of lathes and
milling machines and
n this issue, we are going to work mostly ‘BaseBend’ has appeared in our file tree. Similar to if
CNC kit! on an add-on workbench called ‘Sheet we had extruded our part, we can still make changes
Metal’, so let’s get that installed. Open up to the underlying sketch, and those will be pushed
FreeCAD and click Tools > Addon manager, through to the BaseBend object. There are also
and then scroll down the list to find ‘Sheet numerous parameters in the BaseBend object dialog.
Metal’. Click to install the workbench, and then Notably, you can adjust the thickness of the sheet –
close the Addon manager – you will get prompted to this is useful since the BaseBend object, as you will
restart FreeCAD. see, defines the sheet thickness for the rest of the
Once you have restarted FreeCAD, start a new attached design.
project and, as a very simple first example, let’s first Next, let’s select one of the edges on the
go to the Part Design workbench, create a body, and BaseBend object. We selected the upmost edge line
then create a sketch in the XY plane. of one of the longer sides. With that selected, click
Inside the sketch, let’s create a rectangle around the ‘Extends one or more face, connected by a bend
the origin point. We don’t need to fully constrain this on existing sheet metal’ tool icon, which should be
sketch, but let’s give it a horizontal and a vertical second from the left in the Sheet Metal workbench
constraint, making it roughly 12 cm by 6 cm. Once toolbar. You should now see that we have created a
this is done, close the sketch. Without making further new section of our sheet design, folded at 90 degrees
changes to this sketch, we can move straight away to to the original sheet (Figure 2). This new object
the Sheet Metal workbench. In this workbench, with appears in the file tree labelled ‘Bend’ and subsequent
our sketch highlighted in the file tree, let’s click the bends will be labelled ‘Bend001’, ‘Bend002’, etc.
‘Create a sheet metal wall from a sketch’ tool icon, Highlighting the ‘Bend’ object in the file tree, we
Figure 1 which should be the furthest to the left on the Sheet can adjust plenty of parameters. We’ll leave the
An example design
that could be Metal tools toolbar. first parameter, Bend Type, as it is, set at ‘Material
fabricated from You should see that our sketch has been extruded Outside’, but have a glance at the options for later on.
a single piece of
sheet metal slightly to form a sheet, and that a new object called You’ll note that our new folded section is folded down

86
FORGE

YOU’LL NEED
A computer with
FreeCAD 0.19

from the original BaseBend object in the Z axis. If we Next, let’s select one of the short edges of our
wanted this section to fold upwards, we can change BaseBend rectangle sheet and add a second bend to
the ‘angle’ parameter in the dialog. Setting this to -90 create a wall at 90 degrees. You’ll notice that at the
rotates the folded section to point upwards. Similarly, corner where the two folds meet, there is a small
we can set the angle of this fold to any amount we gap. This is a by-product of working in sheet metal,
choose. Moving down the parameter list, we can use where the radius of a fold means that folded sections


the ‘gap1’ and ‘gap2’ stand slightly off the
parameters to make the BaseBend object. You
folded object not the full Corner relief is a small also may note that the
length of our attached cutaway that, similar to the two folds join together at
BaseBend edge. So, for a very sharp point where
earlier notches, stops the


example, in Figure 3, they join the BaseBend
we have added a gap metal distorting when folded object. Again, in real life,
value of 10 mm to each that sharp convergence Figure 2
Creating an initial
of those parameters. point could create ‘BaseBend’ object
and adding our rst
You may need to click the ‘Recomputes the current distortions in the piece as it is folded, so it can be a folded section
active document’ button or press CTRL+R to see the good idea to add some corner relief. Corner relief is
Figure 3
changes in your model. a small cutaway that, similar to the earlier notches, Adding gaps
You’ll notice that not only does the bend object stops the metal distorting when folded. To add corner automatically can
add notches which
reduce in length by the gap amount, but also that relief, we need to select the two edges which run would allow sheet
there are some small ‘relief’ notches automatically into the corner on the BaseBend object. You can see metal to be folded
without distorting at
added at the end point of the bend. This is good these edges selected in Figure 4. the fold point
practice in sheet metal work as, if you fold a bend that
connects to a straight edge, the end of the bend will
distort the straight edge at the point it joins it. Adding
the notch stops this distortion from occurring.
If you wanted to not have a relief notch added, you
can scroll down to the ‘Parameters relief’ section and
set the relief factor to ‘0’ and then set the ‘use relief
factor’ setting to ‘true’. This option might be useful if
you are using the Sheet Metal workbench to design
using different materials, such as thin card or plastics.
Before we move on, please also note that, in the
‘bend’ object dialog, you can change the length of the
added bend part. Before we add more bends, undo or
delete any changes you have made so that we have
our simple BaseBend, and our first bend object that is
full length with no gaps, etc.

87
www.dbooks.org
Sheet folding in FreeCAD

TUTORIAL

With the two lines selected, the ‘Corner Relief to


sheet metal corner’ tool icon should become active
(seventh from the left on the Sheet Metal workbench
toolbar). Clicking the tool should create a corner
relief object in the file tree, and also create a circular
hole in the corner of the two folds (Figure 5). There
are options for other corner relief geometries in the
corner relief object dialog. Whilst a circular relief
might be easy to create in a flat sheet design using
a drill, you might prefer a square relief or another
shape. Finally, there are also options for ‘circle scaled’
and ‘square scaled’ geometries. These are useful as,
if we use a scaled corner relief but then add other
folds around that corner, as we are about to do, the
scaled relief is sized so that it won’t interfere with the
subsequent fold. Therefore, after experimenting, set
the corner relief to ‘circle scaled’.
As you can see, we automatically appear to be
making a tiny metal tray or lid! We might in real life
want to create folds around the corners of the side
Figure 4 FOLD GEOMETRY walls to create a very rigid structure. If we select
To set up a corner
relief, you must select
the two edges that When you fold sheet materials, including sheet one of the outer edges of the shorter sides folded
run into a corner point metals, there are numerous forces in play inside the wall and click the ‘Extends one or more faces’ tool
between folds
fold. On the inside of the fold, the material is under again, another bend object appears and we now
a compression force and, on the outside of the fold, have a folded metal piece that completes the corner.
the material is being expanded. In the diagram below, However, this piece currently sits inside/on top of the
the dotted green line represents the line through the
other folded wall section (Figure 6). Of course, this
material where these forces swap from compression
to extension and vice versa. This line is called the would be impossible to make, so we need to use an
neutral axis. In different materials and at different offset to place this fold correctly.
thicknesses of materials, this line will be in different
positions. The reason this is important is that it dictates ADD AN OFFSET
where fold lines are accurately placed to create the Highlight the new bend object in the file tree and, in
overall dimension of a piece accurately. The position
the dialog, click the drop-down menu for the ‘Bend
of the neutral axis is given as a ratio of the material’s
thickness; this ratio value is called the K-factor. You can
Type’ option. Select ‘Offset’, and now the new fold
search online for the K-factor of a given material at a will be offset by the amount specified by the ‘offset’
given thickness, but also be aware of what industrial field further down the dialog. Our material is 1 mm
standard the K-factor value is being stated in, either thick, so if we change the offset amount to 1 mm, the
ANSI or DIN. We found that a K-factor ratio of 0.4 ANSI new section is on the outside of the two tray walls.
was commonly given for 1 mm aluminium sheet. Using Or, if we input -1 mm, then the fold sits on the inside
this value when using the ‘Flatten sheet metal folded
of the walls. Whilst this works, it does mean that
object’ tool will ensure that all your fold geometry is
accurate for the material you wish to use. our material touches inside the folded overlapping
sections. This becomes an issue later in the process
when we want to flatten our design, as it requires a
clearance between folded surfaces. Therefore, set
compression your offsets to 1.1 mm to create external folds with a
small clearance. Having created all the parts to make
one corner of our metal tray, we can continue around
the BaseBend object, adding further folds and corner
reliefs until we have four walls with folded corners.
One interesting thing to note about designs made
this way on the Sheet Metal workbench is that they
extension can still be manipulated and worked on by tools on
other workbenches as normal. One quick example is to

88
FORGE

Figure 5
Adding corner relief
to points where folds
adjoin can make it
easier to produce your
design accurately in
sheet metal

our design back out after we have completed it.


QUICK TIP
Flattening and unfolding the design then allows us to
We covered the
see the basic shape of the flat sheet that we need to
basics of the Part
cut to create our object. To flatten the design on the
Design workbench
Sheet Metal workbench, we need to select a face and the Sketcher
which will be the reference plane to flatten the part workbench way back
to. With our metal tray design, the obvious choice in issues 37 and 38.
is to pick the outer large surface of the BaseBend
object. With that face highlighted, you then need
to click the ‘Flatten sheet metal folded object’ tool
icon, which is fifth from the left on the Sheet Metal
workbench toolbar. You should now see a dialog
move to the Part Design workbench, select a suitable box appear, titled ‘unfold sheet metal object’; you
edge, and apply a chamfer or a fillet. A more useful may also see that the report window opens at the
example is to perhaps add sketches to our metal tray bottom of the screen with a report that ‘engineering
design. If we were to fabricate this tray, we might like mode is not enabled’. Don’t worry about the report
to add holes in the design for bolts or rivets to fix the window message: just close the report window. In
folded corners firmly. To add a sketch to this design, the dialog box, make sure that ‘generate projection
you work exactly as if you were adding a sketch to sketch’ is ticked and then also tick the ‘Manual
any face in any design. First, move to the Part Design K-Factor’ box. When you tick that box, you will
workbench and select one of the external folded tab need to input a K-factor value. We read that an 0.4
faces and click the ‘Add a sketch’ button. We then ANSI value was appropriate for our 1 mm thick sheet
drew a 2 mm radius circle, imagining we might use a metal design when working in aluminium.
4 mm diameter rivet. Again, just like any sketch on a
face, we used the ‘Create an edge linked to an external
geometry’ tool to be able to position our circle relative
to the end of the folded tab, (Figure 7).
Closing the sketch, we then used the pocket tool
on the Part Design workbench to create a hole, and Figure 6
Initially when you
selected ‘through all’ as the type so that the holes create an overlapping
would be created on both sides of the design. Whilst corner, it is placed
directly on top of the
we could have done this in a single sketch, we added other folds
another sketch to create the same holes at the other
Figure 7
end of our tray. Setting up a sketch
To fabricate an object, such as our tray created to create holes for
tures in our
from a folded sheet, we need to be able to flatten tabbed metal tray

89
www.dbooks.org
Sheet folding in FreeCAD

TUTORIAL

sketch item visible, and then highlight it and use File


> Export to export a variety of file types (DXF, SVG,
and many more) to create printable plans, or to use
to create G-codes for a milling machine or to cut on a
laser cutter.
Whilst there is a lot of mileage in what we have
looked at so far, there is the fact that everything we
designed in our tray example was a fold that started
or extended from an existing edge of an object. Let’s
Having input 0.4 and ticked ‘ANSI’, we can then look at using sketches to create fold lines that are not
Figure 8 click the ‘OK’ button. Depending on your computer, on the edge of items but inside the face of a sheet. To
Flattening our design it may take a few moments but, once processed, begin, we created a new project, moved to the Part
creates a flat D
object of our unfolded you should now see two new objects in the file tree Design workbench, and created a sketch in the XY
sheet, and also a
sketch object
view – ‘unfold’ and ‘unfold sketch’. These two new plane. In the sketch, we drew the object in Figure 9.
items exist outside of the active body containing our You don’t have to faithfully recreate this sketch,
folded design; so, to tidy the file tree view, we can but you can create something similar to play with
close the drop-down menu of the active body so that these techniques.
our file tree just has three visible list items: ‘Body’ Moving back to the Sheet Metal workbench for
and the two new unfolded items. You can also see a moment, we selected our sketch and clicked the
in the preview window our two new items: a blue ‘Create a sheet metal wall from a sketch’ tool icon
line sketch and a semi-transparent unfolded sheet again to create a basic BaseBend object. Notice
of our design. Toggling off the Body item in the file that, similar to padding or extruding a sketch, this
tree means we can inspect these items more clearly tool acknowledges that internal geometry is going
(Figure 8). Of course, like most objects, we can to be a void. Next, we want to create some further
change the appearance and position of these items. sketches that will act as folding lines for our project.
Let’s aim to fold each side wing twice at 45 degrees.
NUMEROUS USES Move again to the Part Design workbench, highlight
We can use these items in numerous ways. For the upper face of our BaseBend object, and create a
example, we might use the ‘Unfold’ object to be the sketch on it.
basis of an engineering drawing by pushing views of For our first fold sketch, we drew a vertical line
the object through to the TechDraw workbench and across one of our wings 15 mm in from the edge,
adding dimensions and coordinates. This is useful which we imported using the ‘Create a linked edge’
if you needed to traditionally mark or scribe a layout tool. Once this single line was set up, we closed the
onto sheet metal. You could also make only the sketch and returned to the Sheet Metal workbench.

Figure 9
A sketch that contains
a number of internal
holes and has side
‘wings’ to be folded in
numerous places

90
FORGE

Figure 11
Our winged object,
flattened, has
retained all the
additional features
and folding points
on the sketch and
D ob ect

Figure 10
ur rst old using
a sketch line as a
fold position

To create this fold, you first need to select the face


where the sketch is attached on the BaseBend object
in the preview window; this feels a little counter-
intuitive and we naturally would select the whole
BaseBend object in the file tree, but this doesn’t
work. With the correct face selected, hold the CTRL
key and click the sketch in the file tree. With these
two items highlighted, you should now see that the
‘Fold a wall of metal sheet’ tool becomes visible.
Click this tool icon and you should see a 90-degree
bend appear in your part at the sketched line, a ‘fold’
item appears in the file tree, and the sketch should be
toggled to not visible. Highlighting the fold item, you
can then use the dialog to make changes – we set our area of the circle rather than inside it. We repeated the
fold to 45 degrees (Figure 10). process above for the other side of the object and, as
a finishing touch, we added a chamfer to the upper
SUMMING UP wing corners using the chamfer tool in the Part Design
For our next fold, we again used the Part Design workbench. You can see the completed item in
and the Sketcher workbench to create a sketch Figure 1. One of the reasons we added the chamfers
containing a line that went across the ‘wing’ at the was to prove that even when you add geometry on
point it connected with the circular centre section other workbenches, the ‘Flatten folded sheet metal
of our object. Again, we created edges linked to object’ will still work correctly and carries through all QUICK TIP
external geometry to be able to draw the line precisely geometry on the designed object. In Figure 11, you When creating
at those points. Moving back to the Sheet Metal can see that we have flattened our designed part, and sketches that will
workbench, we again selected the upper face of the everything is still present and correct. act as fold lines, you
object and then selected our sketch containing the It’s been a pleasure to explore this workbench and, need to create each
line in a separate
fold line. Applying the ‘Fold a wall of sheet metal’ tool, in the most part, we have found it very straightforward
sketch, as you
we again set the fold angle to 45 degrees and, this in use. We particularly like that the workbench can will need to adjust
time, we also changed the ‘position’ to ‘backwards’ accomplish so much with so few tools, and this fold parameters
as this meant the radius of the fold lay outside the flat makes for a pretty straightforward experience. individually.

91
www.dbooks.org
This stunning 224-page hardback book not only tells
the stories of some of the seminal video games of
the 1970s and 1980s, but shows you how to create
your own games inspired by them using Python and
Pygame Zero, following examples programmed
by Raspberry Pi founder Eben Upton.

Get game design tips and


tricks from the masters

Explore the code listing


and find out how they work

Download and play game


examples by Eben Upton

Learn how to code your own


games with Pygame Zero

Available now hsmag.cc/store

www.dbooks.org
Digital cutting with craft vinyl

TUTORIAL

Digital cutting
with cra t inyl
Add some vinyl adornments and beautification
to… well, pretty much anything!

Nicola King
@holtonhandmade

Nicola King is a freelance


writer and sub-editor who
also enjoys trying her
hand at new crafts on a
very regular basis. Her
‘craft room’ is looking
rather full…

O
ver recent years, digital cutting Finally arriving at the digital cutting party earlier
machines have become hugely this year, this author purchased a Cricut Joy
popular amongst the crafting (hsmag.cc/CricutJoy), one of the smaller and less
and making communities. Brands expensive options in the marketplace. This particular
such as Brother, Silhouette, Cricut, machine is useful if you want to cut vinyl (one of
to name a few, have developed the most used materials in the crafting and design
a range of machines that enable users to cut industry), and provides an easy way of adding a
bespoke shapes from all sorts of materials, including graphical element to just about anything you want.
cardstock, foam boards, leather, and even thin metal So, for those new to cutting vinyl, in this tutorial
sheets. The key advantages to using such a machine we’ll take an introductory look at how to use a digital
are the degree of precision and uniformity that you cutting machine to add some vinyl embellishments
get, the ability to cut extremely complex shapes, to everyday items, with a warning that once you
Above along with the speed of cutting – you could certainly start messing about with vinyl cutting, it’s difficult
The results of our
labours the nished try cutting such things by hand, but the results to stop – the world of digital cutting is something of
HackSpace mug, achieved with a digital cutting machine would be far a rabbit hole. You’ll find yourself looking around the
ready or our ne t
coffee break more impressive in comparison. house for things to label, decorate, and generally

94
FORGE

from the Cricut family. This author does purchase


a monthly subscription to Cricut Access, which
enables access to a huge number of extra designs,
one of which we’ve used on a bath bomb holder
(see image below). It’s not necessary to sign up to
these subscriptions, but it often provides access
to thousands of designs and projects that you’d
otherwise have to pay for.
In order to digitally cut your vinyl, whatever design
you have needs to be a vector (directional) image, in
our case an SVG file – it’s a common type of vector
file that many cutting machines use to determine in
which direction to send the blade. For this tutorial,
we initially used Adobe Illustrator vector-based
software. We took our logo into Illustrator and edited
it slightly before saving it as an SVG file. You can
do the same thing in Inkscape – many of you will
already be familiar with these pieces of software. Above
Above This is the ricut
ou can add your designs to a ast array o items Once you have done that and your file is ready to go, Design pace, on
the rest is easy! the i ad, in which
we ad usted and
improve with some colourful vinyl images, graphics, positioned the logo
and pearls of wisdom.
BLANK CHECK
THE BASICS Whilst it’s obviously a good idea to upcycle/improve
Firstly, it only seems fitting for this tutorial that we an item that you already own, if you don’t already
embellish something with the HackSpace logo, so possess anything that you’d like to enhance with some
we’ve chosen an inexpensive, plain white mug that vinyl flourishes, or you are considering making gifts for
was idling in the back of the cupboard as our base. people, then craft blanks may be the answer, and we’ve
used some of these as examples within this tutorial.
Ceramics are an easy item to stick vinyl to, and they
There is a huge array of various bases available in
make great personalised gifts. the marketplace, including acrylic (think coasters, key
In terms of the vinyl we’ve used here, it’s simply rings, baubles, drinking bottles), glass blanks (such as
the branded Cricut adhesive-backed, permanent vases, tea light holders, storage jars), ceramic bases
vinyl that can be found online. However, don’t feel (such as mugs, money boxes, tiles, plant pots), along
that you need to stick with a certain brand, as vinyl with wooden, metal, and textile blanks. A search on
the internet will soon give you plenty of options, and
choices are wide, and a search on Amazon will soon
websites such as amazon.co.uk and hobbycraft.com
throw up many different options. We’ve also used have a host of choices. With a craft blank you are
a holographic, non-brand vinyl on a couple of items, starting from scratch, and the world is your oyster in
and it worked just as well. With our cutting machine terms of how far you go in personalising or embellishing
plugged in, and our iPad to hand to control the your item.
cutting process, we’re almost ready to start.
YOU’LL NEED
DESIGN Access to a digital
cutting machine
Many of the digital cutting machine manufacturers (and a device to
have created design ‘spaces’ for users of machines control your cutting
machine, e.g. iPad)
to upload to and create their designs in. Some you
need to pay for and subscribe to; others are free An item to be
for a certain number of image uploads – it really embellished
depends on the manufacturer and machine you Craft vinyl
are using.
Transfer tape
In terms of this tutorial, we will be using the
Cricut Design Space, which you can get as a free Weeding tool
and scraper
companion app on your smartphone or iPad, and
it’s designed to work specifically with machines Scissors

95
www.dbooks.org
Digital cutting with craft vinyl

TUTORIAL

UPLOAD AND PREPARE TO CUT


Using your smartphone or whatever device you have
linked up to your cutting machine, upload your image.
In Design Space, on the ‘Canvas’, we sized our image
to fit the mug and just tweaked it until we were happy
with the dimensions, ‘ungrouping’ it so that we could
edit it properly. Edit your image at this point if you
need or want to. Of course, you don’t need to upload
an image from somewhere else; you can design your
own in Design Space for example, or use the free or
purchasable images available to you there – it’s your
choice. Easy example: you could just choose a font
and create someone’s name, ready for printing onto
an item.

CUTTING
Happy with the design? Now, let’s cut it. With our
machine, and using the design facilities available to
us, there’s an option at the bottom of the screen to
‘Make it’.
It’s then just a case of following the directions
given. Our machine asked us if we would be using a
Above VINYL VARIETY mat or not to cut. With the roll of vinyl we were using,
ur digital cutting
machine in action, this wasn’t necessary, so we proceeded to the next
its blade ollowing
the ector design step, which was selecting the type of vinyl we were
Below
going to use – in our case ‘Smart Vinyl – Permanent’.
eeding is the At this point, we found that it wanted to cut out
process o remo ing
e cess inyl rom the HackSpace logo as separate, rearranged letters,
the design as shown in the on-screen preview – this can be
resolved by selecting the Actions > Attach option for
the selected image on the Canvas, so it then prints as
a single entity, with the letters in the correct order.
The machine then asks you to load the materials
For this tutorial, we’ve used a permanent, adhesive- required, and all that involves is feeding the end of the
backed vinyl – the design you create with this will
QUICK TIP stick to your item, and can’t be moved, and this is
vinyl roll into the mouth of the machine. The machine
Think about the particularly useful if you are embellishing plant pots, grabs the end of the vinyl, pulls it in and checks the
colour of the object for example, or anything that might sit outdoors. size is adequate for cutting desired image, and then
you’re decorating It’s also perfect for mugs that might go through a all you have to do is select ‘Go’ for the machine to
before choosing dishwashing cycle. However, that’s not your only begin the cutting process. Watching the blade deftly
a vinyl colour that option, as the range of vinyl types available is ever- cut back and forth, up and down, knowing exactly
will stand out well growing, and they come in a range of colours and
against it – a darker where it has to go, is a mesmerizing and decidedly
finishes, from holographic to glitter to chalkboard.
colour works well on If you want to remove a design from something, quick process. We actually cut two of our HackSpace
glass and acrylic. then there are adhesive types of vinyl that are image – one for either side of the mug.
specifically for temporary application, and these are
a great idea for a first project, since they are easier PREPARING TO STICK!
to work with as the adhesive is not as strong. There is Once your machine has finished cutting, you’ll
also adhesive vinyl that is temperature-sensitive, so
normally be given an option to unload the vinyl,
will change colour if placed on a mug that’s filled with
then it’s back to you, and time to prepare the vinyl
hot water. In addition, as well as adhesive-backed,
you’ve also got the option of using heat-transfer vinyl, in readiness for sticking. Cut off, from the rest of
which you iron on to textiles such as bags, cushions, the roll, the section of vinyl that’s been worked on.
and T-shirts – something that we looked at recently in Now, we need to ‘weed’ the vinyl – nothing to do
HackSpace, issue 46 (hsmag.cc/issue46). with gardening, it just means removing the excess
vinyl from the piece. Specialist weeding tools can

96
FORGE

a heat press that works with Cricut’s specialist


ink to transfer designs onto mugs, and it might be
an attractive option for some makers. However,
simply adding vinyl to mugs, as we’ve done here,
is still a pretty effective way of customising a piece
of crockery.
Just think of the possibilities – gifting is made
so much easier when you can tailor items to an
be substituted with a pair of tweezers or similar individual, and when our son knows who he’s got
implement. Carefully pull off the vinyl around the in this year’s Secret Santa at school, we plan on
image (it should come away pretty easily) and you personalising their gift with an abundance of vinyl!
should just be left with your design. This small machine and the long rolls of vinyl also
Next, we need to transfer the design to our mug; make it easy to make banners – so wishing your
for that, we need some form of transfer tape. We are nearest and dearest a happy birthday with a banner
Left
using the branded version here but, again, there are you’ve made yourself is achievable. e e success ully
non-branded tapes available if you look for them. Cut Cutting vinyl could also be a new business idea for trans erred our inyl
design to the tape
a piece of tape to the size of your image, and remove you; plenty of people make money from crafting vinyl
the sticky part from the backing paper. Then carefully – just take a look on etsy.com for some examples. Below
Trans erring the
place this, sticky side down, on top of your image Whichever brand of cutting machine you have access design rom the tape
so that it is completely covered. The transfer paper to, get vinyl cutting, add some colour to your world, to the mug –
be careful how
usually has grid lines on it to help you line things up. and see what designs your creativity can dream up. you line it up

TRANSFERRING YOUR IMAGE


Now we need to make sure that the tape picks up
the image, so we need some sort of scraper to push
over the top of the tape (and image) to ensure full
adhesion. This can take a little bit of time, but scrape
backwards and forwards until the image is stuck
to the tape – you can pull the tape off slightly to
check it’s worked. If not, stick back down and give it
another sweep.
When fully adhered, remove the tape, with the
image, from the vinyl backing and position the
image on your item. Do this slowly and carefully
to ensure you place it correctly – once it’s stuck
down, permanent vinyl will be difficult to remove.
(Removable vinyl gives you more flexibility – see the
Vinyl Variety box for more info). Press the image and
tape down until it’s stuck, remove the transfer tape,
and there you have it – in
our case, one super-cool
mug to take pride of SOME SOURCES OF INSPIRATION
place on the mug tree.
There is a multitude of online resources to get those creative ideas flowing. Here are just a few:

TAKE THE PLUNGE • Hobbycraft Ideas Hub – hsmag.cc/HobbycraftIdeas


If you are particularly
keen on the idea of • YouTube (just search for ‘digital vinyl cutting’ and be amazed by what pops up) – youtube.com QUICK TIP
bedecking mugs, Cricut See what you
• Cricut homepage – cricut.com already own that
actually recently brought
could be enhanced
out a specialised mug • Pinterest (here’s an inspirational page) – hsmag.cc/PinterestVinyl with a bit of vinyl
press (hsmag.cc/ flair… you’ll be
mugpress). This • Crafts Selection (some easy ideas here) – hsmag.cc/CraftSelectionVinyl
amazed at how many
machine is basically items you can find.

97
www.dbooks.org
Twinkling LEDs

TUTORIAL

Twinkling LEDs
Light up your Christmas tree

import time
import board
import neopixel
try:
import urandom as random
except ImportError:
import random
bright_div = 20
numpix = 42 # Number of NeoPixels
pixpin = board.A1
# Pin where NeoPixels are connected
strip = neopixel.NeoPixel(pixpin, numpix,
brightness=1, auto_write=False)
colors = [
[232, 100, 255], # Purple
[200, 200, 20], # Yellow
[30, 200, 200], # Blue
]
max_len=5
min_len = 2
Right flashing = []
Just set a few
parameters and num_flashes = 5
your LEDs will for i in range(num_flashes):
start to flash
pix = random.randint(0, numpix - 1)
col = random.randint(1, len(colors) - 1)

L
flash_len = random.randint(min_len, max_len)
ast year this author wrote some code
flashing.append([pix, colors[col], flash_len,
to control some NeoPixel lights on his
0, 1])
Christmas tree. He wanted an organic-
strip.fill((0,0,0))
looking ‘twinkling’ display.
while True:
In a given length of lights, he wanted
strip.show()
individual LEDs to fade in and out in a
for i in range(num_flashes):
Ben Everard random-looking pattern. He wanted the length of
print(flashing[i])
each flash to be independent of the others and to be
@ben_everard pix = flashing[i][0]
a different colour. Since then, he’s reused this code
brightness = (flashing[i][3]/flashing[i]
quite a few times as he likes the effect it gives. While
Ben's house is slowly [2])
the code isn’t perfect, it’s quite battle-hardened,
being taken over by 3D colr = (int(flashing[i][1][0]*brightness),
printers. He plans to and it might be useful for other people working on
solve this by printing an int(flashing[i][1][1]*brightness),
Christmas lights.
extension, once he gets int(flashing[i][1][2]*brightness))
enough printers.
Here’s the code in full (you can download it from
strip[pix] = colr
hsmag.cc/ChristmasLights). We’ll go through it in a
if flashing[i][2] == flashing[i][3]:
bit more detail later, but if you just want to steal it for
flashing[i][4] = -1
your own purposes, we’ll first have a look at how to
if flashing[i][3] == 0 and flashing[i][4]
tweak the parameters.

98
FORGE

== -1:
pix = random.randint(0, numpix - 1)
col = random.randint(0, len(colors)
- 1)
flash_len = random.randint(min_len,
max_len)
flashing[i] = [pix, colors[col],
flash_ len, 0, 1]
flashing[i][3] = flashing[i][3] +
flashing[i][4]
time.sleep(0.1)

The key things you’ll probably need to tweak are:


• The pin you have attached the NeoPixels
to (saved as pixpin). In this example it’s
A1, but it should be whatever you have
physically connected.

• The number of NeoPixels in your chain. This is


stored in numpix.

• The different colours you want to flash. This


is stored in the list colors. Different types of
NeoPixel can have very different appearances
for the same colour value, so it’s worth having
a play about here with the particular hardware 3. The length of this flash
you’re using. 4. The current position in the flash Above
The code works
5. The increment or decrement (basically, 1 if it’s for any NeoPixel-
compatible
• max_len and min_len are the maximum and starting to flash or -1 if it’s ending the flash) to the LEDs, but looks
minimum length of a flash. These are related next position particularly good
on LEDs that are
to the time.sleep() value at the bottom. It can spaced out
make sense to increase the lengths of the Each iteration of the main loop then goes through each
flashes and decrease the sleep value, as this entry in the list in turn, and moves it one more position
will give a smoother transition in and out of along, calculates the colour it should be, and then sets
the flash. This depends on the speed of the the pixel to this colour. If the pixel reaches the end of its
processor running the animation, though, as in flash, then a new pixel, colour, and length are selected
some cases the calculation can take a long time at random.
to run.

• The number of LEDs you want on at a given


” If the pixel reaches the end of its flash, then a new


time (this is held in num_flashes). You can
balance this for either the effect you want, or pixel, colour, and length are selected at random
the amount of juice your power supply can
push out.
This code is non-blocking. That means for each
Tweak those above values and you can customise iteration of the loop, you’re free to do other things. This
this code for your particular project. Let’s now take a could be control other lights, read sensor values, send
look at how it works. Everything is controlled by the data to other hardware, or anything else. Obviously you
flashing list. Each entry in this list is a five-item list might have to adjust the timings to account for that.
that contains: That’s the code that’s powering a surprising amount
of our Christmas (and non-Christmas) lights. If it’s useful
1. The number of the NeoPixel to flash to you, we’d love to see your projects. Get in touch via
2. The colour to flash it to email or social media.

99
www.dbooks.org
DON’T MISS THE BRAND NEW ISSUE!

JUST £5
SUBSCRIBE FROM ce of one
the pri
> FREE! 3 issues for
> FREE! Delivery to yo
ur door
> NO OBLIGATION! Le
ave any time

FREE
PI Z E R O 2 W*

on to the print magazi


ne
pti
s
onth subscri

on
With your 12-m
/12m th
magpi.cc * While stocks
last

Buy online: store.rpipress.cc


FIELD TEST
HACK MAKE BUILD CREATE
Hacker gear poked, prodded, taken apart, and investigated

PG

108

HEAT PG
102
GUN
We test a budget- BEST OF
BREED
friendly, surface-mount
soldering solution

The best development


PG boards for RP2040
112
SEESAW
Get extra features for your
microcontroller

www.dbooks.org
Raspberry Pi’s RP2040 revisited

BEST OF BREED

ONLYTHE
BEST
Raspberry Pi’s
RP2040 revisited
What’s happened since launch?

By Marc de Vinck @devinck

J
anuary of 2021 was an interesting time We covered the new Raspberry Pi Pico and
for the Raspberry Pi Foundation. It had accessories in an earlier roundup. And since the
announced the new 32-bit dual Arm announcement back in January, a robust ecosystem
Cortex-M0+ microcontroller integrated has continued to grow, despite all the supply chain
circuit, dubbed the RP2040. It was a bold issues going on around the world. In this Best of
move from a company known for making Breed, we’ll look at some of the new
single-board computers and not microcontrollers. And, development boards that have been
as usual from the Raspberry Pi Foundation, it’s powerful built around the RP2040.
and affordable, at only $1 for the bare integrated circuit.
With the introduction of the new microcontroller, the
Raspberry Pi Foundation could grab more customers
and grow their community. There are a lot of people
that love working on a computer, and the Raspberry Pi
is an amazing product for them. But many
people also find themselves wanting
the simplicity of a microcontroller,
myself included.
What we didn’t expect was the
power of the RP2040. It’s blazingly
fast compared to other microcontrollers,
with its 32-bit Arm Cortex-M0+
dual-core processor. It also has lots of built-
in features, making it easy to integrate into
development boards and products. Couple the
RP2040 IC with a few external components, and you
have a winning microcontroller.

102
FIELD TEST

Adafruit ItsyBitsy RP2040 vs


Wio RP2040 mini Dev Board
ADAFRUIT $9.95 adafruit.com SEEEDSTUDIO $12.95 seeedstudio.com

I
t’s itsy and it’s bitsy – it’s the Adafruit
ItsyBitsy RP2040. At only 1.4” × 0.7” (36 mm ×
18 mm) in size, it’s amazing that they were able
to pack in so many features and breakout so
many pins. Just like all the RP2040 board variants
out there, it features a fast dual Arm Cortex-M0+
processor, along with a few other nice features.
They have added an 8MB SPI flash chip for storing
all your CircuitPython code, along with an RGB
NeoPixel, a red LED connected to pin 11, and both a
reset button and bootloader select button, so you
don’t have to unplug it to launch your code. There are
a few other more technical features too, so head on Left
over to the website to learn more about this powerful Small, but
not too small
little board.
Below
Take your
RP2040 online

T
he Wio RP2040 mini Dev Board
from Seeed Studio integrates
an RP2040 and a WiFi chip.
Getting connected is easy
since it’s just like using
VERDICT
a Raspberry Pi Pico,
but you get added functionality Adafruit ItsyBitsy
with integrated WiFi, thanks RP2040
to an included ESP8285. The So small and so
available pins on the RP2040 awesome!

10/ 10
are broken out for easy access,
and they are breadboard-friendly. And
you can program it just like a Raspberry Pi
Pico via the Thonny code editor. If you have a
project designed around a Pico, and you’d like to Wio RP2040 mini
get it connected to the internet, then this may be a Dev Board
good plug-and-play solution. Small and
connected.

9/ 10
103
www.dbooks.org
Raspberry Pi’s RP2040 revisited

BEST OF BREED

Adafruit QT Py RP2040
ADAFRUIT $9.95 adafruit.com

S
uper-small, and super-cute, it’s the
Adafruit QT Py RP2040. Much smaller
than the ever-popular Feather format,
yet it still packs a punch. The board
features a USB Type-C port for data and
power, a STEMMA QT connector for
accessories, and an 8MB SPI flash chip for storing
any necessary files and code. My favourite feature is
having both a reset button and a bootloader select
button for quick restarts. You don’t have to unplug the
board to start running your code. Adafruit has a
growing selection of RP2040 boards, so be sure to
check out its site for more information and options.

VERDICT
Adafruit QT Py
RP2040
Extra-small but
still powerful.

9/ 10
ADAFRUIT FEATHER RP2040 Above
For when you’re
short of space
ADAFRUIT $11.95 adafruit.com
‘You can’t go wrong with a Feather’ was the tag line
for my review of this product in an earlier Best of
Breed article, and that statement still stands. The
RP2040 is powerful, but you’ll need it to be
integrated into a PCB to use it, and the Adafruit
Feather RP2040 is the perfect solution. If you’d like
to try out the power of the RP2040, this is a great
place to start.

104
FIELD TEST

SparkFun MicroMod RP2040


SPARKFUN $11.95 sparkfun.com

T
he SparkFun MicroMod Pi RP2040
Processor board is a use-case-specific,
low-cost, and high-performance add-
on board featuring the RP2040
microcontroller. What makes this board
special, and potentially a bit more
limited, is the MicroMod interface. That is, unless you VERDICT
already have a MicroMod Carrier Board. SparkFun
So, what is MicroMod? It’s SparkFun’s ecosystem MicroMod
of Main Boards, Function Boards, and Processor RP2040
Boards that all have M.2 form factor connectors. It An M.2-
works by allowing Processor boards to plug into Main compatible
Boards or Function boards to add additional RP2040.

” What makes this board


Above
Swappable CPUs
for your projects 8/ 10
special, and potentially
RASPBERRY PI PICO
a bit more limited, is the


MicroMod interface RASPBERRY PI $4 raspberrypi.com

The Raspberry Pi Pico is the original RP2040 board brought to you from the
Raspberry Pi Foundation itself. It’s low-cost, powerful, and features a dual-core
capabilities. You could plug the SparkFun MicroMod Arm Cortex-M0+ processor with 264kB internal RAM. Since it’s brought to you by
into an Input and Display Carrier board to add a TFT Raspberry Pi, it’s a must-have for getting started with the RP2040 microcontroller.
display and other functions to your RP2040 – all
without soldering any components. It’s a robust
system with lots of options. Learn more about this
modular ecosystem on the SparkFun website.

105
www.dbooks.org
Raspberry Pi’s RP2040 revisited

BEST OF BREED

Adafruit Trinkey QT2040


ADAFRUIT $7.50 adafruit.com

I
s this a USB key, or microcontroller? The
answer is both! Adafruit has packed an RP2040
onto a PCB that allows you to simply plug it
directly into any available USB port. No cables
required! Or, at least, not for connecting
the RP2040. The board, however, will most
likely have some wires coming off it, since there is
also an integrated STEMMA QT port on the end of
the PCB. This allows you to simply plug and play
with dozens of different sensors, displays, and
electronic components.
And in such a small package, you’d think there
wasn’t anything more else. But there is! You also get
an RGB NeoPixel LED, and 8MB SPI flash for storing
your CircuitPython code, and all the components
needed to keep your RP2040 running. Simply plug in
your Trinkey and get to coding. Easy!

VERDICT
Adafruit Trinkey
QT2040
No cable
required!

9/ 10
Left
Add extra features
to your computer

106
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 107


www.dbooks.org
Direct From Shenzhen

REGULAR

Heat gun
We test out a budget soldering tool

By Ben Everard @ben_everard

S
oldering irons are great, but if you 700 W Heat Gun welding repair tools’, from JCD store
start to work with smaller and more on AliExpress. It’s a little concerning that this is
complex components, you might find labelled a hair-dryer. It’s nowhere near powerful
you reach a point where a hot stick enough for that (but can get hot enough to cause
no longer has the dexterity to do serious injury). It cost £19.94 (including delivery to the
what you need. At this point, you’ll UK), which makes it just about the cheapest of the
need another way of applying heat to your soldered serious hot air tools. You can get cheaper hot air guns,
joins. The most flexible and affordable way of doing but they tend to be the on/off kind with no control
this is with a heat gun that blasts hot air at your PCBs. over temperature or airflow, which makes it difficult
We decided to test one of the cheapest ones we to use them for soldering.
Below could find to see if it was worth the money. At just under £20, this tool comes with three
The controls We got a ‘JCD Hot air gun 8858 Micro Rework nozzles (5, 8, and 10 mm), and can fire air at between
are minimal, but
functional soldering station LED Digital Hair dryer for soldering 100 and 480 °C. Once you power it on, press the

108
FIELD TEST

Setup button to start, then select


the force (for some reason the
scale goes from 5 to 10) and
temperature. Hold Setup to power
off the heater, and the fan will turn
off once the temperature drops to
70 degrees.
We were able to solder and
remove surface-mount
components with this gun without
problems, which we’d imagine
would be the main use of this. It
can also do heat-shrink without
any issues. If you’re after a heat
gun for paint stripping, or other Left
The hand-held
more DIY-y tasks, you might need
unit is large, but
a more powerful model. quite light

IN THE HAND
The hand-held part is a bit
chunkier than some hot air tools,

DIRECT FROM SHENZHEN


as the heater and fan are both in
the portable part. In others, you
often find that the fan is desk-
mounted, and it pipes air to the
hand-held portion. However, it’s
not big or heavy enough to cause
us any real problems.
With a lot of the functionality in
the hand-held part, the desk-
mounted part is just a power
supply and control panel – it’s no
larger than a standard laptop
power brick. If you’re a hobbyist with limited storage limit how useful the device is. The website claims
space, this can be tucked away in a drawer much 150 L/min which, frankly, is a lie. We don’t have the
more easily than most hot air stations. equipment to test this, but it’s nowhere near this
There are a couple of drawbacks. The mount for level. It’s about equivalent to a moderate to gentle
the gun is a bit of a hack. It can be cable-tied onto the blow. This author blows harder when whistling.
top of the device, but We also have some


this interferes with concerns about how
the controls. Having Unsurprisingly for such a long this will last.
hot parts exposed While it worked fine
small device, there’s quite


this close to where for our test, heat guns
you need to put your limited airflow are fickle beasts. It
hands isn’t, in our takes a lot of power
view, a particularly to produce that much
safe idea. There’s nothing to stop you mounting it hot air, and the temperature can also take its toll on
somewhere else, but you’ll need to find a heavy base the parts.
to make it stable enough. While this hot air gun may lack some features, and
The second major issue we had was airflow. we’d like a bit more airflow, there’s still plenty here
Unsurprisingly for such a small device, there’s quite for most uses. Balanced against the price and size,
limited airflow. It was fine for simple use, but it will this can be a good choice for light hobbyist use.

109
www.dbooks.org
THE OFFICIAL
Raspberry Pi
Beginner’s Guide
The only guide you
need to get started
with Raspberry Pi
Inside:
Now • Learn how to set up your Raspberry Pi,
includes install an operating system, and start using it
Scratch 3 • Follow step-by-step guides to code your
projects!
own animations and games, using both the
Scratch 3 and Python languages
• Create amazing projects by connecting
electronic components to Raspberry Pi’s
GPIO pins

Plus much, much more!

£10 with FREE


worldwide delivery

Buy online: magpi.cc/BGbook


www.dbooks.org
Adafruit ATtiny817 Breakout with seesaw

REVIEW

Adafruit ATtiny817
Breakout with seesaw
Add more I/Os to your projects

ADAFRUIT $4.95 adafruit.com

By Ben Everard @ben_everard

T
here are literally hundreds of need. They’re not too hard to use if you plan them
development boards to choose in from the start, but you need space, a PCB, and
from, with a mind-blowing range of generally have to spend time thinking about circuits
processors, memory, storage, pin rather than the awesome stuff you want to achieve
count, and size. Why is it, then, that with your circuits.
we always seem to be missing a feature Enter the Adafruit ATtiny817 Breakout with seesaw.
when we get to our projects? Sometimes it’s because This is basically a configurable STEMMA QT/Qwiic to
we start with one design and keep adding bits until almost anything bridge. If you want to add digital I/Os,
we run out of pins; other times, it’s because we use there are 14 you can use. Nine of them can also be
the dev board we have on hand rather than the most analogue inputs, and five can be PWM outputs.
suitable one. What we like about this board, though, isn’t the
Fortunately, there’s a stock of components that specs; it’s how easy it is to use. Just plug it in via the
can help us. Port expanders, I2C analogue-to-digital STEMMA QT/Qwiic cable and it’s all set up. There are
converters, and more can be tacked onto most libraries for CircuitPython and Arduino, so you can get
microcontrollers to give us the extra features we it working on most maker-level hardware.

Right
The ATtiny817 is, as
the name suggests,
quite small, meaning
that this board can
also be kept
very small

112
FIELD TEST

Once the board is plugged in and initialised,


you can access the pins almost as though they
are native on your main board. Take a look at this
CircuitPython example:

import time
import board
from adafruit_seesaw.seesaw import Seesaw

ss = Seesaw(board.I2C())

ss.pin_mode(5, ss.OUTPUT)

while True:
ss.digital_write(5, False)
time.sleep(1)
ss.digital_write(5, True)
time.sleep(1)

There’s also a buffer for a 60-LED NeoPixel string


to let you output to LEDs without having to worry UPDATE
about the timings on your main processor. If you need This board is an updated version of a previous Above
The two Qwiic-
more features, there are two pins for selecting I2C Adafruit product based on the SAM D09. While Arm compatible STEMMA
addresses and two STEMMA QT ports, so you can processors are typically considered an upgrade over QT connectors mean
you can daisy-chain
chain together up to four of them on a single port. AVRs (as in this product), the newer board has more this board with
What’s nice about this board is how little there is to peripherals. Nine ADCs replace the three previously other sensors

write about it. There are the specs, and they work. If available (although the resolution has dropped from 12 Below
By default, the
those specs are what you need in your project, then bits to 10 bits), and five PWM pins replace the three I/Os will operate at
this board is likely to be a good choice. Often reviews on the older board. These extra features, as well as the whatever voltage you
supply, or you can
are about caveats and considerations, but in this case, two STEMMA QT ports, make it a big improvement. use the jumper on the
there’s not a lot for us to add. At $4.95, it’s a bit more expensive than using the back to select 3.3 V

We could talk about how you can use this as a equivalent specialist IC for a task (such as an I2C port
more general ATtiny817 development board, but expander for extra GPIO), but it will save you time.
honestly, don’t bother. It’s not really designed for this, How much depends on how familiar you are with
and you’ll need a UPDI programmer – there are better the other solutions. It also makes assembly easier as
options for only slightly more money. Instead of you don’t need a PCB or breadboard. How those two
wasting words on this, we’ll leave the space for some things stack up – cost and time – depend on a few
lovely pictures of the board in action. things: how familiar you are with the alternatives; what
else is in the projects; whether
or not you’re likely to reuse the
board in another project; how
interesting you find spending
time learning about alternatives.
We can see it being
particularly useful as a way of
adding analogue inputs to a
Raspberry Pi, but that’s really
only one part of what it can do. VERDICT
The beauty of this board is its Does exactly
flexibility, ease of use, and its what you’d
price. It’s one of those boards expect it to.

9/ 10
that you’ll almost certainly
find yourself reaching for time
and again.

113
www.dbooks.org
#51 ON SALE
20 JANUARY

ASSISTIVE
TECHNOLOGY
ALSO
PCB DESIGN
3D PRINTING
CIRCUITPYTHON
LEDS
AND MUCH MORE

DON’T MISS OUT

hsmag.cc/subscribe
www.dbooks.org

You might also like