HackSpace Magazine - Issue 50
HackSpace Magazine - Issue 50
HackSpace Magazine - Issue 50
VINYL RP2040
CUTTING The best dev
boards tested
Customise your mug
DIY
LIGHT CHRISTMAS
PAINTING
Jan. 2022
Issue #50 £6
LIGHTS
Take photography Control lots of LEDs
to the next level this festive season
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
44
hsmag.cc/hello
PAGE
[email protected]
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?
28 Crowdfunding now
Light up your letters
Tutorial
Vinyl cutting
Cover Feature
32
4
CONTENTS
74
06
46
Meet the Maker
Lewis Aburrow
102
66
Resurrect a broken lathe with a Raspberry Pi Pico
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
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
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
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
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
24
SPARK
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
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
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
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
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
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
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
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
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
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.
SUBSCRIBE
on app stores
From £2.29
Buy now: hsmag.cc/subscribe
Free Pico with print subscription only
VINYL RP2040
CUTTING The best dev
boards tested
SAVE
hsmag.cc
Customise your mug
December 2021 Issue #49 hsmag.cc November 2021 Issue #48
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
GLASS D A TPAINTING
A GRAFFITI L E D S P LIGHTS
ICO BUBBLE WRAP PLA
Jan. 2022
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
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,
48
LENS
Left
The diffuser (left)
smooths out the
light of 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
50
LENS
51
www.dbooks.org
Matt Stultz
INTERVIEW
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
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!”
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.
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
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?
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
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.
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
Right
These e posed
traces really add to
the look o
the decoration
68
LENS
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
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
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
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
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:
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.
82
FORGE
83
www.dbooks.org
Sensory world: Build a fire and gas leak alarm system
TUTORIAL
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
84
FORGE
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
85
www.dbooks.org
Sheet folding in FreeCAD
TUTORIAL
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
88
FORGE
Figure 5
Adding corner relief
to points where folds
adjoin can make it
easier to produce your
design accurately in
sheet metal
89
www.dbooks.org
Sheet folding in FreeCAD
TUTORIAL
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
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.
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
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
95
www.dbooks.org
Digital cutting with craft vinyl
TUTORIAL
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
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)
”
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
With your 12-m
/12m th
magpi.cc * While stocks
last
PG
108
HEAT PG
102
GUN
We test a budget- BEST OF
BREED
friendly, surface-mount
soldering solution
www.dbooks.org
Raspberry Pi’s RP2040 revisited
BEST OF BREED
ONLYTHE
BEST
Raspberry Pi’s
RP2040 revisited
What’s happened since launch?
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
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
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.
”
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
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
REGULAR
Heat gun
We test out a budget soldering tool
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
IN THE HAND
The hand-held part is a bit
chunkier than some hot air tools,
”
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
REVIEW
Adafruit ATtiny817
Breakout with seesaw
Add more I/Os to your projects
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
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)
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
hsmag.cc/subscribe
www.dbooks.org