Nothing Special   »   [go: up one dir, main page]

HackSpace Magazine July 2023

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

hsmag.

cc July 2023 Issue #68

DIY
SMART CAMERA
PROGRAM YOUR OWN
PHOTOGRAPHY MACHINE

   
  

   




    
   



   

July. 2023
Issue #68 £6

HEXAGONS LEDS MACRAMÉ E- I N K


Free eBook!

Download your copy from


hsmag.cc/freecadbook
WELCOME EDITORIAL
Editor
Ben Everard
ben.everard@raspberrypi.com

Features Editor
Andrew Gregory
andrew.gregory@raspberrypi.com

Welcome to Sub-Editors
David Higgs, Nicola King

HackSpace magazine DESIGN


Critical Media
and Raspberry Pi
criticalmedia.co.uk

Most people receive the majority of their information about Head of Design
Lee Allen
the world through their eyes. This is great, but they do have a
Designers
few flaws. You can’t adjust the frame rate on them, they need Sam Ribbits, Olivia Mitchell,
to be switched off for around eight hours a day, and there’s no Sara Parodi, Jack Willis
Photography
record function on them. Brian O’Halloran
Fortunately, inventive scientists have come up with a
CONTRIBUTORS
solution for this – cameras. These let you see the world in Marc de Vinck, Andrew Lewis,
Rob Miles, Jo Hinchliffe,
ways impossible with our on-board faculties. While there Nicola King, Phil King

are some excellent off-the-shelf cameras available, you can PUBLISHING


get much more control by building your own, and there’s one Publishing Director
Brian Jepson
standout platform for this: Raspberry Pi. brian.jepson@raspberrypi.com

In this issue, we’re looking at how you can combine Advertising


Charlie Milligan
programming with a range of camera modules to capture the charlotte.milligan@raspberrypi.com

world in ways our primitive face-holes simply can’t manage.


DISTRIBUTION
The results are fun, beautiful, and give us a new perspective Seymour Distribution Ltd
2 East Poultry Ave,
on the world (literally).
London EC1A 9PT
+44 (0)207 429 4000
BEN EVERARD
SUBSCRIPTIONS
Editor ben.everard@raspberrypi.com
Unit 6, The Enterprise Centre,
Kelvin Lane, Manor Royal,
Got a comment, Crawley, West Sussex, RH10 9PE
question, or thought To subscribe

30
about HackSpace 01293 312189
magazine? PAGE
hsmag.cc/subscribe

get in touch at Subscription queries


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

3
Contents 76

06 SPARK 21 LENS
06 Top Projects 22 Photography
Oh my, you makers are clever Now you can buy a Raspberry Pi, here’s how to use it

16 Objet 3d’art 32 How I Made: Off-grid power tools


Like Bitcoin, but fewer bits and more metal Recharge batteries your way

18 Letters 38 Interview: Tim Hunkin


Don’t fear the Furby Inside a secret life

46 In the workshop
Reverse-engineering an LED display

Cover Feature Tutorial


Bluetooth keyboard

DIY SMART
CAMERA
70 Customise your wireless typing rig

22 08
4
CONTENTS

32
Tutorial
Recycling

86
Interview
Tim Hunkin

58 Save our precious planet one


failed print at a time

51 FORGE
52 SoM KiCad
Taking your first steps with RP2040

58 Tutorial Recycling PLA


Squeeze and squish your old prints into new things
38 Tim helped a generation of makers
peek inside hidden worlds
64 Tutorial Beginning microcontrollers
Make electrons follow instructions

68

Tutorial Polycarbonate
The most futuristic-sounding printer filament
85 FIELD TEST
70 Tutorial Bluetooth keyboard 86 Best of Breed
Because you’re too cool for off-the-shelf typing The newest new things that are newly released

76 Tutorial Planetary gears 92 Review Hextraction


Build a drive chain that’s out of this world Waste even more time with your 3D printer

82 Tutorial Macramé 96 Crowdfunding Wyldcard


Like 3D printing, but it’s meant to look like spaghetti Code your own e-paper card games

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 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. HackSpace mag-
azine is published monthly by Raspberry Pi Ltd, Maurice Wilkes Building, St. John’s Innovation Park, Cowley Road, Cambridge, CB4 0DS, United Kingdom. Publishers Service Associates, 2406 Reach Road, Williamsport,
PA, 17701, is the mailing agent for copies distributed in the US and Canada. Application to mail at Periodicals prices is pending at Williamsport, PA. Postmaster please send address changes to HackSpace magazine
c/o Publishers Service Associates, 2406 Reach Road, Williamsport, PA, 17701.

5
Top Projects

REGULAR

Mechanical
Apple Watch
By Jack Spiggle hsmag.cc/NanoRobotGeek

M
echanical watches aren’t just timepieces:
they’re miniature works of art, engineering
marvels. They don’t run out of battery power and,
if you look after them, they can last for decades.
This author has a cheap pocket-watch made to the
famously high manufacturing standards of the late
USSR, and it’s still functioning to this day.
The natural thing to do with an old, useless Apple Watch then,
is to replace its obsolete electronics, unsupported software, and
drained battery with a mechanism that’ll tell the time without
constantly annoying you with updates from social media. That’s
what Jack Spiggle has done with this build, augmenting a 42 mm
Apple Watch Series 1 in stainless steel with a Seiko NH38 watch
movement. Jack’s donor watch had been unsupported by Apple
since 2020, and the battery life was down to just four hours – he’s
rescued it from the scrap-heap and put it to brilliant use.

Right
We prefer the
dumb watch to
the smart watch

6
SPARK

7
Top Projects

REGULAR

Four-shaft
loom
By Asli Aydin Aksan hsmag.cc/4ShaftLoom

W
eaving is a complicated business; so much
so that you could plausibly argue that
computer programming was invented as a
by-product of encoding weaving designs.
This design, by architect, researcher, and maker
Asli Aydin Aksan, is a more complicated build
than some other homemade looms we’ve seen, but the brilliance of
that is that it enables the user to create more complex patterns than
you would if you were using a simpler loom.
What we love about this is that it’s open-source, so anyone can
learn from, copy, and modify the design to suit their work. And it’s
not a toy; Asli’s woven real, useful bits of fabric with it. It’s also ideal
for anyone who doesn’t have a Victorian cloth mill in which to store
it: in use, the loom takes up 600(L) × 440(W) × 310(H) mm, and
folds away to 202(L) × 440(W) × 310(H) mm.

Right
Laser-cut plywood
and 3D-printed
attachments (plus the
nous to make it work)
are all you need to
build your own
weaving machine

8
SPARK

9
Top Projects

REGULAR

Cold War phone


Nixie clock
By Bad Dog Designs bad-dog-designs.co.uk

W
e’ve marvelled at the work of Paul Parry
(aka Bad Dog Designs) before in these
pages; here’s one of his latest builds. Paul
has got his hands on some Cold War-era
military field telephones, and, of course, has
turned them into Nixie tube clocks.
Both telephones are housed in bakelite enclosures; the lighter-
coloured one (shown here) is a Russian TA-57 telephone dating
from 1968–1975; the darker one is a Polish TAP-67 dating from
somewhere between 1968 and 1974.
Both phones feature programmable RGB LED back-lighting to
show off the Nixies in their best light, four Z570M Nixie tubes, and
tell the time accurate to plus/minus one minute per year.

Right
The Nixie tubes in
Paul’s latest clocks
should last for 20
years or more

10
SPARK

11
Top Projects

REGULAR

Planet Spinner
By Frans van Hoesel hsmag.cc/PlanetSpinner

A
n orrery is a mechanism that shows the relative
positions of the bodies in our solar system.
You can have small ones, showing just the Earth,
the sun and the moon, and there are larger ones
showing all nine planets (Pluto is still a planet,
whatever scientists may say).
This is another example of a build that is simple on the surface –
it’s comprised of laser-cut plywood and toothpicks – but that’s only
because of the hard work and original thinking of the original creator.
There are no complex gears on this orrery. Instead, a tiny stepper
motor rotates the disc that shows the signs of the zodiac. This has
a pin sticking up from it, and this in turn rotates all the planets until
the one closest to the sun is in place. The disc then spins back in
the opposite direction until the next planet is in the right position,
and so on, until the entire solar system is in place (at least, the
solar system as it was known before 1781, when William Herschel
discovered Uranus). Frans says that he’s “surprised that no one
before me came up with the idea to move planets like this without
a complex gearing system.” We’re not surprised at all; it’s a leap
of imagination that makes it different from any other orrery we’ve
seen, and yet it makes perfect sense when you see it in action.

Right
The Planet Spinner
resets once a day at
midnight, and takes
its data over the
internet from NASA

12
SPARK

13
Top Projects

REGULAR

PicoCray
By Derek Woodroffe extremeelectronics.co.uk

W
hat’s the first thing that happens when
new computer hardware is released?
Someone runs DOOM on it. What’s the
second thing that happens? Someone builds
a cluster. It’s been over two years since the
Raspberry Pi Pico came out, and in that time
nobody had built a Pico cluster, so Derek Woodroffe decided that
he’d do it himself.
Inspiration for the build came from the 1970s Cray
supercomputers and, with a little custom electronics and the magic
of I2C, Derek’s put together a very small supercomputer that he’s
using to calculate Mandelbrot sets. If you like the sound of this, tune
in next issue for more details on the hows, the whys, and
the wherefores.

Right
A Cray wouldn’t be a
Cray without some
kind of seating
around it. Derek’s
replicated this in
2 mm thick red foam

14
SPARK

15
Objet 3d’art

REGULAR

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

I
n the olden days, before we paid for
things with contactless cards, we
used to hand over little metal discs
to shopkeepers in exchange for
goods. Unbelievable, right? What’s
more, everything used to cost really weird
numbers, like £9.99, so you’d hand over
your money and get a tiny bit of money
back, which used to rattle around uselessly
once you got home.
Seriously though, we still use coins, and
we still have jam jars full of old bits of
shrapnel that we really should convert into
more useful money. That’s where this
beautiful bit of design by Fraens comes in.
His coin sorter uses a rotating drum with
differently sized holes in it to sort coins in
order from smallest (10 c) to largest (€2).
There’s a TRCT5000 infrared sensor
mounted on each coin ejection slot, to
detect when a coin falls through, and an
Arduino to count each coin and keep a tally
of how much your change is worth.
Other than 3D-printed parts, the machine
has a laser-cut plywood base and a clear
acrylic lid, so you can watch your money
spinning around and falling like a metaphor
too complicated for us to understand.

hsmag.cc/CoinSorter

16
SPARK

17
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

LET US BUILD
It feels like we’re on the edge of a transport revolution. Electric
motors are (fairly) cheap and (fairly) easy to work with at the
size needed for modest personal transportation. They’re even
relatively easy to retrofit onto human-powered transport, as
Andrew Lewis showed in his e-scooter build in issue 67.
However, politicians are dragging their feet on the legislation
needed to make them legal. Perhaps we need an orchestrated
maker campaign to get Westminster to let us build our own
vehicles. We could have a future of personalised machines
made specifically for each person’s needs. Want small and
lightweight? No problem. Need to move the kids? Sure, just bolt
on a few extra seats. Delivering cargo? You decide how big to
make your carrier.

Theo
Bristol

Ben says: We try not to be too political here at HackSpace


magazine, but it’s utterly absurd that, here in the UK, it’s legal
to rent an electric scooter from a multinational corporation but
not to buy or make one yourself. Obviously, there will need to
be some regulation to ensure people build machines that are
not excessively dangerous, but there’s a long history of
homemade bikes, so this doesn’t feel like it should be a
difficult hurdle to jump.
Rest assured that when politicians do finally come to their
senses (we’re not holding our breath), we’ll have a full series on
how to create your own Mad Max-inspired cyberpunk chariot.

18
SPARK

MECHANICAL MONSTROSITIES
Can you please not feature any more Furby projects? They are creepy beyond
words and should be cast aside. It was a mistake to ever manufacture them. We
should, as a species, leave them behind to rot in the landfills of the world where
they belong.

Robin
Dover

Ben says: There is occasionally a fine line between creepy and cute, and Furbys
sit directly on this line. Some parts of them are quite lifelike, some completely
mechanical. I think part of the reverence for them today is that we don’t seem
to make mechanical things like this any more. Were they made today, they’d
have miniature screens to display their faces, not animatronic eyes.
They also originate from a time when artificial intelligence (AI) was just
starting to be something that people were aware was a real thing. Though it
seems absurd now, an internal memo at the US’s National Security Agency
(NSA) read: "We are prohibited from introducing [Furbys] into NSA spaces.
Those who have should contact their Staff Security Office for guidance."
As we’re living through another wave of AI panic, it’s perhaps reassuring that
the Furbys haven’t (yet) taken over the world.
We can’t quite put our fingers on it, but Furbys say something about what it
means to be human in an increasingly machine-dominated world. They span
the gap between animal and machine (at least in our minds). Yes, they
sometimes feel uncomfortable, but in that discomfort is a message – a lesson
on how we should build the future. We’re still trying to fully understand that
lesson, and, until we do so, we’ll continue to feature Furby projects. Sorry.

THANKS JO
It’s hard to think of someone who has done more for hobbyist 3D printing than Josef
Průša, other than perhaps Adrian Bowyer. Not only has he created an iconic series of
machines, but he has also kept his designs open-source for others to learn from.
Along with Limor ‘LadyAda’ Fried, he’s an inspiration showing how you can build a
successful business on open-source hardware. I don’t know where the maker scene
would be without people like these.

Alexis
Norwich

Ben says: The thing that unites Prusa and Adafruit hardware is how easy it is to work
with. It’s well-documented, and there are people to help when things don’t quite seem
right. It’s also hackable and easy to tweak it to your own needs. In both cases, you can
get cheaper hardware (and in some instances, that might be a better option), but for
the extra money, you get a whole lot of value.

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

PG

32
HOW I MADE:
PG
22
OFF-GRID
POWER TOOLS DIY
SMART
Go camping, and take
your workshop with you

CAMERA
PG

38
INTERVIEW:
TIM HUNKIN CAPTURE IMAGES
YOUR OWN WAY
We meet the man who inspired
our childhoods

PG

46
IN THE
WORKSHOP
A lot of LEDs and not
enough pins
DIY Smart Camera

FEATURE

DIY
SMART
CAMERA
WITH A RASPBERRY PI AND CAMERA MODULE,
THE POSSIBILITIES ARE NEAR ENDLESS

C
ombining the power and versatility of a Raspberry Pi
single-board computer with a compact Camera
Module – or larger HQ Camera with interchangeable
lenses – enables you to take great pictures and
videos and do a whole lot more. There’s also the
Phil King option of 3D-printing or modifying a case to create an all-in-one
compact camera. Or, one with an eyepiece tube to fit a telescope
A long-time
Raspberry Pi user for spectacular shots of the night sky.
and tinkerer, Phil is a Using the NoIR Camera Module variant, which omits the IR
freelance writer and filter, you can even capture images in the dark (with IR LED
editor with a focus
on technology. illumination) – ideal for night vision, nocturnal creature photos,
or even a ghost detector.
With the addition of machine learning computer vision,
advanced projects enable you to identify objects and monitor
your body movements during workouts.
Other fun project possibilities include a photo booth, security
surveillance system, wildlife camera trap, and time-lapse
photography. Lights, camera, action!…

22
LENS

MAKE A TIME-LAPSE VIDEO


COMBINE A SERIES OF STILL IMAGES INTO A SPED-UP VIDEO

O
ne of the easiest, and yet most
impressive, uses for a Raspberry Pi
camera is to film a time-lapse video
created from a series of still images.
Sometimes used for interludes in film
and TV dramas, to indicate the passing of time
between scenes, a time-lapse video is an
impressive and versatile effect that appears to
speed up time. Classic examples include clouds
passing across the skyline, city traffic moving (a
lot faster than in reality), star trails, a sunset or
sunrise, and plants blooming/growing.
With a Raspberry Pi Camera Module or High
Quality Camera, you can easily create effective
time-lapses. You just need to set everything up
correctly and make sure the camera doesn’t move
during the filming period.

STEP 1: CONNECT THE CAMERA


Above
You will need to connect the Camera Module or
You can connect the Make sure that the
High Quality Camera before switching on your camera is connected

Raspberry Pi, otherwise it won’t be detected. If the Raspberry Pi to a monitor to to the correct port

ribbon cable isn’t already connected to the check the camera is working
camera’s CSI connector, pull the plastic tab out
and insert the cable (with the covered blue side
facing the plastic tab), then push the tab back in. Alternatively, you can enable SSH when writing
On the Raspberry Pi, insert the other end of the the Raspberry Pi OS image to a microSD card in
cable into its Camera port in similar fashion. Note the advanced options of the Raspberry Pi Imager
that on a Raspberry Pi Zero, the Camera port is on tool (click the cog icon after choosing an OS), as
the edge of the board and is narrower, so requires well as altering the host name and/or setting
a special ribbon cable/adapter. Make sure both up the Wi-Fi connection to your router so the
cable ends are snug and secure – a poor Raspberry Pi automatically connects to it on
connection can stop the camera working. first boot.
If you’re only going to be using the Raspberry
STEP 2: REMOTE ACCESS Pi remotely, you may want to just install the Lite
You can connect the Raspberry Pi to a monitor to version of Raspberry Pi OS, which lacks a desktop
check the camera is working – by entering the and therefore takes up less room on the card and
libcamera-hello terminal command for a five- is quicker to boot.
second camera preview. You can SSH into the Raspberry Pi from the
When filming a subject, however, you may well terminal/PowerShell of another computer using
want to position your camera away from a monitor the Raspberry Pi’s IP address:
– in which case, you will need to access the
Raspberry Pi remotely via SSH (Secure Shell) to ssh [username]@[IP address]
control it. You can set up SSH in the Raspberry Pi
Configuration menu’s Interfaces tab, or in the You can find the IP address of your Raspberry Pi
raspi-config tool from the command line. by entering hostname -I at the command line – or,

23
DIY Smart Camera

FEATURE

if you don’t have it connected to a monitor, by scene. The V1 and V2 Camera Modules have fixed
checking the devices list on your wireless router focus, while the V3 has the option of continuous
web page to find it. autofocus. The exposure mode is automatic by
Alternatively, you can use the Raspberry Pi’s default, although you can use the --ev parameter
host name instead of an IP address. It’s to make it lighter/darker or use one of several
raspberrypi.local by default, but can be set to exposure scenes, e.g. night, with the --ex
another name in Imager’s advanced options. parameter. Note that conditions may change
during the shoot, however.
ssh [username]@raspberrypi.local The HQ Camera’s focus and aperture can be
adjusted manually by rotating parts of the
Either way, you’ll be prompted to accept the attached C- or CS-mount lens (see hsmag.cc/
connection by typing ‘yes’ (the first time), then HQCmountLens or hsmag.cc/HQCSmountLens).
asked to enter the Raspberry Pi’s password. You’ll
then see the usual command line prompt for it. STEP 4: TAKE A TEST SHOT
The latest versions of Raspberry Pi OS have
Above STEP 3: POSITION YOUR CAMERA libcamera-apps pre-installed. While these replace
If you don’t have a The main thing to ensure when filming a time-lapse the previous raspistill and raspivid commands,
purpose-made camera
mount, you can make one video is that your camera doesn’t move, otherwise they work almost the same way with a similar
it’ll ruin the effect. So it’s best to place it in one of range of options. To take a test still image with the
the many Camera Module mounts, which can be camera, enter:
bought cheaply – or, if using an HQ Camera, you
can screw it onto a standard camera tripod. libcamera-still -o test.jpg
An alternative for filming exterior scenes is to
stick the camera to a window using a special You’ll see a stream of information in the terminal
mount with suction cups, such as the ZeroView as the shot is taken. If you’re using a desktop
(hsmag.cc/ZeroView) which can also hold a version of Raspberry Pi OS and are connected to a
Raspberry Pi Zero W on the rear. monitor (or are accessing the desktop remotely via
At this point, you may want to take another test VNC), you can view the photo in the Image Viewer
shot to check the focus and light level for the desktop application. If not, you can copy it to your
local computer using SCP (Secure Copy):

scp [username]@[Pi's IP or hostname]:test.jpg

RASPBERRY PI CAMERAS [/local/path/to/save]

There is a range of official Raspberry Pi cameras available. For more details and full Enter the Raspberry Pi’s password to proceed.
specs, see hsmag.cc/RPiCameraDoc. Third-party cameras are also sold, but may Check that the test shot looks OK before
require their own software libraries. proceeding with filming the time-lapse. Otherwise
you may want to reposition the camera or alter
• CAMERA MODULE V2: An upgrade of the original 5MP, fixed-focus Camera some of libcamera’s settings – see the
Module, this tiny camera features adjustable focus and an 8MP sensor. Available in
documentation for more info: hsmag.cc/libcamera.
standard and NoIR (for low-light shooting) versions.

• CAMERA MODULE V3: Upgraded with HDR (high dynamic range), a 12MP
sensor, and – most notably – motorised focus which can adjust automatically when
shooting video. Available with a standard (70°) or wide-angle (120°) lens, both
coming in standard or NoIR versions. It can also record HD video at 50 fps.

• HIGH QUALITY CAMERA: A larger board with a 12.3MP sensor, it enables you
to attach different C- and CS-mount lenses with manual focus and aperture. There is
also a version for M12 lenses.

• GLOBAL SHUTTER CAMERA: Similar to the0 HQ Camera, with


interchangeable lenses, it has a much lower 1.6MP resolution, but a global – not
rolling – shutter that’s ideal for shooting fast-moving subjects. Above
Summer has finally come!

24
LENS

Left
We love watching clouds
move in fast-forward

STEP 5: LET’S DO THE TIME-LAPSE


You can start shooting a time-lapse with a single
libcamera-still command with the --timelapse
OCTOLAPSE
option and a few parameters. For example: As well as using OctoPrint on a Raspberry Pi to monitor and
control your 3D printer via a web interface, you can install a
libcamera-still -t 30000 --timelapse 2000 -o plug-in called Octolapse that enables you to shoot cool 3D
image%04d.jpg printing time-lapses. See hsmag.cc/Octolapse for more details.

Here, the number after -t is the total duration in


milliseconds, in this case, 30 seconds. The number
after --timelapse is the interval between images in
milliseconds, in this case, 2 seconds. Finally, we ffmpeg -r 10 -f image2 -pattern_type glob -i
use %04d to add a four-digit number to the file 'image*.jpg' -s 1280x720 -vcodec libx264
name, after ‘image’, starting with ‘0000’. timelapse.mp4
By varying the timings, you can take much longer
time-lapses with more or less frequent image Here, the number after -r is the frame rate, in this
captures. For slower scenes, such as clouds and case, 10 fps – try varying it for different results. The
star trails, use a longer interval between captures; next part tells it to pattern-match your set of image
for faster ones, such as traffic or people, a shorter files using the * wildcard. The numbers following
interval is better to capture the movement without -s (scale) determine the video resolution. The final
it appearing too disjointed. If you’re shooting a part uses the x264 encoder to save the video as an
long duration via SSH, you may want to use the MP4 file.
nohup prefix before the command. Short for ‘no Depending on the Raspberry Pi model and the
hangup’, this will ensure it continues working even number of images, this may take a while to
if the SSH connection is lost. complete. A Raspberry Pi 4 is pretty quick, but
other models are slower (a Raspberry Pi 3 will
STEP 6: COMPILE THE VIDEO encode around two frames per second). So you
Once you have your sequence of stills, it’s time to may instead want to transfer the image files to a
compile them into a time-lapse video. For this, a more powerful computer via SCP:
good option is the ffmpeg command-line tool. It
should be pre-installed in the latest version of scp [username]@[Pi's IP or hostname]:image\*.
Raspberry Pi OS; if not, install it with: jpg [/local/path/to/save]

sudo apt install ffmpeg …and then use ffmpeg on that to compile the video
much faster. Now you know the basics, have fun
Compile the time-lapse video from your images experimenting with different subjects and interval/
with a command like this: frame rates to create impressive time-lapse videos.

25
DIY Smart Camera

FEATURE

RASPBERRY PI CAMERA PROJECTS


INSPIRATIONAL IDEAS FOR YOUR RASPBERRY PI CAMERA MODULE

WILDLIFE CAMERA
A popular use for a Raspberry Pi Camera Module
is for capturing close-up shots of wildlife. By
adding a PIR sensor to detect movement, you can
activate the camera whenever animals are in the
field of view – although you may also get a few
false positives triggered by people or vehicles
passing by.
When placing your camera outdoors, you’ll want
to protect it and the Raspberry Pi from the

HOME SECURITY elements with a weather-proof enclosure. This


could be a transparent box or something more
purpose-built, such as the NatureBytes
Low-cost and tiny, Raspberry Pi Camera Modules Above (naturebytes.org) Wildlife Camera Case – there’s
The rectangle
are ideal for home security video surveillance. indicates that also a fully-fledged kit, including a Raspberry Pi
There’s even a special operating system, motion has been and rechargeable battery pack. Just point it at a
detected (by
motionEyeOS (hsmag.cc/motionEyeOS), that comparing frames) bird feeder and you’ll get some spectacular shots
makes it super-easy to set up one or more of your feathery friends.
cameras which can be viewed and controlled via a To take photos of nocturnal creatures, you could
web interface. set up a similar PIR-triggered camera trap at
Just head over to the GitHub repo’s supported ground level with a NoIR Camera Module and an
devices page (hsmag.cc/motionEyeOSDevices) IR LED ring (lisiparoi.co.uk) that fits around its lens
and download the relevant version for your for non-visible flash/illumination. Alternatively,
Raspberry Pi model (or other single-board you could place a NoIR camera in an empty bird
computer). The wiki has full instructions for how box, ready to view its occupiers when they arrive:
to configure everything, including a network of hsmag.cc/IRBirdBox.
multiple cameras/devices – including USB
webcams. Numerous features include motion
detection to trigger photos/videos, email/push
alerts, and time-lapse videos.
You could use it to catch porch package thieves.
Alternatively, check out Canadian maker Ryder’s
custom deterrent system that uses machine
learning to recognise packages and people,
triggering an alarm and showering the thief with
flour and water (hsmag.cc/ThiefDeterrent).

Above
Pointing your camera at a bird feeder is a sure-fire way to
photograph various species, such as these long-tailed tits

26
LENS

COMPACT CAMERA
While the Raspberry Pi Camera Modules can be
used in mounts or, in the case of the HQ Camera, on
a tripod, you can also incorporate one into a case so
it looks more like a traditional compact camera.
Among the numerous 3D-printable designs
available, one project that caught our eye is PolaPi
Zero: hsmag.cc/PolaPiZero. Not only does its case
enclose a Raspberry Pi Zero and Camera Module,
but there’s an LCD on the rear for a live view.
Inspired by old-school Polaroid cameras, it also
features an Adafruit Nano thermal printer that
produces a physical monochrome copy of
your photo.
If you want to use the larger HQ Camera on the
move, check out James Martel’s project (hsmag.cc/
RPi4HQCamera) for inspiration. He modified an
existing case for a Raspberry Pi 4 and LCD to
incorporate a mounting plate for the HQ Camera.
Alternatively, you could hack an official Raspberry Pi
case to add an HQ Camera and screen, like Richard
Hayler did – see The MagPi issue 94 for a guide: Above
Richard Hayler’s modified case packs in an
hsmag.cc/MagPi94. HQ Camera, Raspberry Pi 4, and LCD

PHOTO BOOTH
A fairly simple Raspberry Pi camera project is to
build your own photo booth, which is a fun
addition to any event. Baulking at the high hire
prices for commercial booths, Jack Barker made
one for his own wedding (to Pam). Building the
main booth structure from plywood, he cut out a
section for an LCD screen and drilled holes for a
large arcade button below and the Raspberry Pi
Camera Module above.
Pressing the button starts a seven-second
countdown with an instructional slide, followed by
a live view from the camera so you can see
yourself on screen and perfect your pose.
While the wedding venue’s lack of Wi-Fi
scuppered Jack’s plan for live online photo
backup, he added a printer to the booth to produce
instant copies of the photos.
If you fancy making your own photo booth,
Above take a look at Jack’s seven-part build guide:
For illumination, this booth features a strip of ultra-bright LEDs diffused by an angled piece of wood.
Credit: Jonathan Lang Photography hsmag.cc/JackPhotoBooth.

27
DIY Smart Camera

FEATURE

NIGHT VISION
All of the standard Raspberry Pi Camera Modules
are available in a NoIR version which omits the
infrared filter. This gives it the ability to see in the
dark with infrared lighting, opening up all sorts of
possibilities, such as monitoring nocturnal animals
and the health of plants. Note that it is also possible
to manually remove the IR filter from standard
Camera Modules and the HQ and GS Cameras – see
hsmag.cc/RPiCameraDoc for details.
Dan Aldred built a night vision camera
(hsmag.cc/NightVisionCam) enabling him to see in
the dark, just like in the Splinter Cell classic video
game. While he used a third-party camera with IR
Above
LEDs, connected to a Raspberry Pi Zero, you could See in the dark with a night
instead use a standard NoIR Camera Module to vision camera, perfect for a
midnight feast
creep around like a stealth operative.
Or you might want to try detecting some ghosts, Left
I ain’t ’fraid of no ghost! Scan
like Anthony DiPilato. Not only does his handheld for paranormal presences with
this Ghost Detector
Ghost Detector (hsmag.cc/GhostDetector)
incorporate a NoIR Camera Module and touchscreen
for night vision, but also EMF sensors with twin
antennae, mic, compass, temperature sensor, and
even a Geiger counter.

FITNESS TRAINER
A positively healthy use for a Raspberry Pi camera
is to monitor your body movements while you’re
exercising. With the use of computer vision, you
can then analyse how well you are doing during
your workouts.
This is especially important if you’re engaging in
high-intensity interval training (HIIT) on your own,
to make sure you’re doing it right for optimum
results. Using a Raspberry Pi aided by Google
Coral USB Accelerator, James Wong created a
machine learning Raspberry web app to track his
Above movements and poses and then score them based
HIIT Pi: each video frame is analysed using the PoseNet model in
TensorFlow Lite to detect and track the user’s pose
on a set of pre-defined standards. Find code and
instructions on his GitHub repo: hsmag.cc/HIITPi.
If you prefer your exercise to be a little less
intense, Salma Mayorquin and Terry Rodriguez’s
YogAI (hsmag.cc/YogAI) combines a Raspberry Pi
magic mirror with AI yoga pose recognition to
help guide you.

28
LENS

VISION AID
For blind and partially sighted people, a Raspberry
Pi and camera can provide a way of seeing by
analysing the view and turning it into audio.
Inspired by a blind cousin, Robert H‘obbes’ Zakon
built a Seeing Wand that can speak the name of
whatever it’s pointed at. When the user presses
the button on the prototype device, the Camera
Module attached to its Raspberry Pi Zero takes
a photo; this is sent to Microsoft’s Cognitive
Services Computer Vision API to obtain a
description, which is then spoken using the
eSpeak text‑to‑speech tool. Find the build details
at hsmag.cc/SeeingWand.
Alternatively, the All-Seeing Pi (hsmag.cc/
AllSeeingPi) is worn on a partially sighted user’s

ASTROPHOTOGRAPHY head and sends a video feed from the camera to a


display right in front of their eyes to give them a
more detailed, close-up view of the environment.
Due to its compact size, a Raspberry Pi Camera Above
The PiPiece
Module is ideal for using with a telescope to take attached to a
images of the night sky. David Palmer’s PiPiece telescope, enabling
the Camera
project (hsmag.cc/PiPiece) is based around a Module to capture
3D-printable case for a Raspberry Pi Model A and the night sky

Camera Module with an eyepiece tube design


available in various sizes to fit most amateur
astronomy telescopes.
The project does involve removing the tiny lens
of the Camera Module, which should be done
carefully to avoid damage to the sensor. Once it’s
fitted to the telescope, you can adjust the latter’s
eyepiece to focus, as you would normally. The
field of view is small, so fine alignment of the
telescope is required to observe a planet or other
celestial body.
Alternatively, if you lack a telescope, a
Raspberry Pi HQ Camera fitted with a suitable
zoom lens should enable you to take detailed
shots of the moon – it requires good aperture
selection and careful focus. For more on
Above
astrophotography, check out the feature in The It may look a little makeshift, but the Seeing Wand is easy to build
MagPi issue 128 (hsmag.cc/MagPi128). and the code is on GitHub: hsmag.cc/SeeingWandGH

29
SUBSCRIBE
TODAY
FOR JUST £10
Get three issues plus a
FREE Raspberry Pi Pico W
delivered to your door
(UK only)
hsmag.cc/FreePico

Subscription will continue quarterly unless cancelled


SUBSCRIPTION

Get 6 issues plus a $43 USA / €43 EU


FREE Raspberry Pi
Pico W for just… £40 Rest of the world

SAVE
23%
How I Made: Power in the Wilderness

FEATURE

HOW
I By Andrew Lewis
W
orking with power
tools in the wilderness
can be fun, whether
you’re building a secret
bunker in expectation
of societal collapse, or repairing your
bike at the side of the road. Unfortunately,

MADE
you’re limited in how much you can do by
the need for power. Solar and 12 V engine
power can’t be used to charge power tool
batteries directly, and not every
manufacturer provides a DC power solution
for charging their products. In this article,
you’ll see how to use some off-the-shelf
components to create your own power tool
charger that will run off anything from a
cigarette lighter socket to a solar cell.

POWER IN THE
WILDERNESS
Charging your power tool batteries off-grid

32
SAFETY !
LiPo batteries pack a lot of power
into a small space, and can
discarge that power quckly. This
is both the best and worst thing
about them. When controlled, it
means we can power all sorts of
things without taking up too much
space. When uncontrolled it
means we have an explosion.
In order to charge LiPo batteries
safely, you have to understand
how LiPo batteries work in
general, how your speciffic LiPo
batteries work, and how your
specific charger works.
If you don’t feel confident with all
three of these, then it’s probably
best to work with off-the-shelf
solutions from brands you trust
until you gain the expience and
knowledge to do this safely.

Left
If you’re off-grid, it
makes sense to cut
out the mains inverter
whenever you can.
This charger has been
converted to run
from 12 V DC

What I used
> 5S battery management system
hsmag.cc/5S-BMS
> DC buck-boost converter
hsmag.cc/DCBuckBoost
> Arduino Uno
hsmag.cc/UnoRev3
> ACS712 current sensor
hsmag.cc/ACS712Module

Modern power tool batteries can be


dangerous things. We’ve all seen YouTube
videos of LiPo batteries erupting like the
Fagradalsfjall volcano in Grindavik after
they’ve been mistreated, and that volatility
makes the idea of messing with them a little
bit scary. You should have a healthy amount
of fear of LiPo batteries, because they are Above
dangerous, but that doesn’t mean that we This DEWALT battery
has handy indicators
can’t work with them. It just means that we for each pin to tell you
have to be careful. In this article, we’ll look what they do. Take care
when translating these
at one way of charging them, but only pins to a BMS, as the
undertake this if you properly understand pins on the PCB can
be in a different order.
the risks involved. Take special note of the
The first thing you need to do is look at locations of the positive
and negative terminals
the battery and charger, taking note of any relative to pins C1 to C4

33
How I Made: Power in the Wilderness

FEATURE

useful indicators that can help you find the


correct pinout. In the case of a DEWALT
battery, the battery itself is labelled to show
the pin functions. The pins as labelled are:
B+, TH, ID, C1, C2, C3, C4, and B-. We can
take a good guess at what we think these
pins do, and then confirm by checking with
a multimeter, or even pulling the battery
apart to take a look. B+ and B- have double
height connections, which shows that we
Above can expect high current from these pins –
The BMS wired up to
the connector for the the multimeter confirms these are the main
battery. The notes used battery terminals. C1 to C4 seem likely to be
to figure out the pinout
can be seen on the sheet connections to the individual cells of the
of paper below. Keeping battery, and by using the multimeter to
notes like this is really
important to ensure you check from the B-, we see that each of the
don’t get confused and connections C1 to C4 have an increasing
make a mistake when
working on boards voltage from around 3.8 V up to 15.3 V,
with more than a
couple of connections
increasing by about 3.8 V for each
connection. That seems to confirm that

34
LENS

LIMITING CURRENT
The best choice of DC-DC power supply for this project is a DC buck-boost supply that can provide
a constant current of around 6 A, with current limiting. Set the voltage output for the supply first, by
connecting the input power to a bench power supply or battery, and checking the output voltage with a
multimeter. Use the voltage-adjust capacitor to set the correct output voltage (21 V for the BMS), keeping
your eye on the voltage as you turn the screw on the voltage capacitor to make sure you’re going in
the right direction. Next, set the current to
the minimum by turning the current limiting
capacitor to its minimum value (this usually
means turning the screw counter-clockwise
at least 30 revolutions). Connect a load to the
output of the power supply and look at the
output voltage. If you don’t have a suitable
dummy load, you can use the BMS controller
with a battery connected to it. Turn the load
capacitor clockwise and measure the current
on the input of the buck converter until the
current drain is around 6 A. Setting the current
higher than 6 A is possible if you use active
cooling, but is not advisable if you aren’t. The
BMS runs at 21 V, so 6 A or just over should
yield roughly 3 A charging current, which is
similar to the original battery charger.

“THE BATTERY ITSELF


each of these pins is connected to a
IS LABELLED TO SHOW
separate cell.
The DEWALT charger takes 240 V AC, and THE PIN FUNCTIONS”
outputs the correct voltage for charging
either 12 V, 14 V, or 18 V batteries. If we take
a look at the board, we can see that it’s Charging a series of 18650 cells is a
Above
pretty complicated. While it is possible to common problem, and there are off-the- This power supply
hack this board directly and get it to charge shelf solutions for building new battery has current limiting
and variable voltage
from a DC power source, it’s actually a bit packs and chargers safely. Battery capacitors, and also
has a surface-mount
easier if we just throw the charger circuitry management system (BMS) boards are fuse built directly onto
away and start again with some off-the-shelf cheap and cheerful ready-made solutions the board. Adequate
fuses are critical in a
components. We can simplify things more if that will protect your battery from system like this, where
we just assume that we are going to be overcharging, excessive discharge, and unfused short circuits
can be catastrophic
using only one type of battery: in this case, many other things. Where cheap BMS
the 18 V flavour. The only part of the charger boards fall down is that they don’t usually
we need is the plastic case and the have any sort of indicator lights, and they
connector that attaches to the battery. You don’t often have any thermal protection.
can go ahead and desolder this connector That’s not a big problem, and you can solve
and fling everything else into the ‘scavenge it by adding an Arduino into the mix to
for parts’ box in your workspace. monitor the BMS board.

35
How I Made: Power in the Wilderness

FEATURE

OUTPUT -
QUICK TIP
If you’re going to rely on an
unregulated 12 V input for
the charger, you should
consider protecting the 7805
regulator on the Arduino.
Adding a heat sink or a small
buck converter to regulate
the input voltage might be
enough to stop an overheat.

OUTPUT +

SENSING CURRENT

To charge an 18 V battery pack, the BMS The ACS712 current sensor uses a Hall effect probe to measure
current passing through a circuit. The output from the sensor is
board will need around 21 V. Most cars and
analogue, and with a 5 V power source, the sensor should return
portable solar solutions work at 12 V, so we 2.5 V when there is zero current flowing. The ACS712 is available in
need to increase the voltage as efficiently as three versions: 5 A, 10 A, and 30 A. Each of these versions returns a
we can to get the required amount of different voltage level per amp of current. The 5 A version returns
power. You’re probably familiar with DC-DC 0.188 mV per amp, the 20 A returns 0.1 mV, and the 30 A returns
buck converters if you’ve worked with 0.066 mV. To measure the power used by the BMS, the power should
be connected in the positive line between the buck-boost power
Arduinos or Raspberry Pis for a while – they
supply and the BMS. It’s worth noting that this method type of sensor
are those little variable voltage supplies that
can pick up a bit of electrical noise, so it’s best to use a threshold
can drop 12 V to 3.3 V or 5 V efficiently. You cut-off to stop the LEDs from showing the wrong information.
may even have noticed that some of those
types of board are labelled as ‘buck-boost’
converters. The word boost in that context
means that the supply can boost the output
voltage higher than the input – in other
words, you can convert 12 V or less input the charger is idle. You can download the
into a 21 V output. Arduino showing how to monitor the power
When it comes to monitoring the BMS, and indicate the charger status using LEDs
you can use an Arduino with a Hall effect from hsmag.cc/issue68. LEDs are a cheap
probe-based current sensor to keep an eye and effective tool for creating a charge
on how much power the board is drawing at indicator, although, if you wish, you could
any given time. High current means the include an LCD output that displays more
battery is charging, while low current means detailed charge information.

36
LENS

Below
Fitting everything
inside the case can be
tricky. Remember to
allow plenty of space
for air flow, add a
fan if necessary, and
insulate any exposed
connections. Hot glue
can be useful to help
with the layout and
wire management,
but hold boards in
place with mechanical
fixings like machine
screws. If the system
overheats, you don’t
want critical items like
boards breaking free
of their fixings and
floating around free
inside the case

37
m
Tim Hunkin

i
INTERVIEW

T n
HackSpace magazine meets…

Tim Hunkin
The not-so-secret life of automata

u
T
hink of automata, and the
image that pops into your
head will most likely depend
on your age. If you’re a child
of the 1980s, you’re most
likely imagining the seaside
amusement from the film Big that turns
a child into Tom Hanks. If you’re a child
of the 1880s, you might be thinking of
the Mechanical Turk, the machine that
terrified audiences by seeming to play
chess against a human opponent.
Others still may think of the works
of Tim Hunkin. He’s been building
machines to inspire and delight for
decades, and now has two arcades full of
his own creations: Novelty Automation
in London, and the Under The Pier Show
in Southwold. We caught up with him
to chat about precision, engineering,
and the joy of the mechanical in a
digital world.

38
m kin
LENS

n 39
m
Tim Hunkin

i
INTERVIEW

T n
40
u RIght
If you ever want to
learn about cutting
metal, Tim’s the
man to teach you
m kin
LENS

HS Your essay on precision reminded


me of something my father used to say
whenever I was helping him with DIY
jobs: “We’re not building pianos.”

TH I like this one: “Jack of all trades,


master of none – but oftentimes better
than master of one.”

HS Is there still room for the Jack of all

n
trades? It feels like graduate jobs have
replaced apprenticeships as entry-level
jobs so, by default, any new engineer,
programmer, or whatever will have three Above
Welding is just one of many maker skills that
or four years’ specialisation behind looks easy when Tim does it
them already.
TH I hadn’t thought of it like that, but I
TH Good question. You’re right that big guess it’s basically true. It’s partly
companies now only hire people who because most engineers work on big
tick the boxes. But it’s much less projects where the huge scale needs
proscribed for tiny businesses – which mathematical calculations and any
is now where most innovation comes mistakes are hugely expensive.
from. Will Jackson, a friend who runs Generally, people think of engineers as
Engineered Arts, a successful robot boring – I don’t, but it can be useful.
company, generally only employs school


leavers who pass his tests to show their
aptitude. For something like robotics, it’s Generally,
essential to be able to move seamlessly
people think of
from hardware to software when solving
problems. So, although it often feels like engineers as
being an old hippy or being a Jack of all boring - I don’t,
trades, I still feel it’s very valuable – if, but it can


for nothing else, to reduce
development costs.
be useful

HS You say in your essay on precision


that, “Sadly most engineers have to be Trapped talking to someone tedious at a
intensely conservative about their party, saying that I’m an engineer is a
designs. It’s expensive to try anything sure way to get them to move on.
new, and even more expensive to rectify I often try out new stuff but am also
something that doesn’t work. Also, quite conservative. I think the reason
because they rarely make their own why there aren’t any other ‘homemade’
parts, any detail that’s imperfect is arcades is that it’s so hard to make the
alarming to them, even though the part machines reliable enough. Many of mine
might still work perfectly well.” have now been used over 100,000 times.
On this logic, I’d argue that most So, personally, I am both – inventor
people who make things for their own and engineer.
consumption – makers, home tinkerers
– would be inventors, rather than HS I was amazed to discover on a recent
engineers. Do you agree? And do you see visit to the Science and Industry
yourself as conservative in your Museum in Manchester that Joseph
own designs? Whitworth built a system that could

41
m
Tim Hunkin

i
INTERVIEW

T n
u
Above
“In the past, all humans
used tools to build things,
but now they can’t even
build their own nests”

measure to an accuracy of one-millionth TH Yes. Vernacular architecture has a friends with the architect. Designing the
of an inch in 1840. How does the average charm no architect can match. Many tiger enclosure, the architect found the
garage-based inventor/maker get more tourists flock to ‘picturesque’ only ‘off the peg’ vertical gates were
anywhere near this level of accuracy? villages than to ‘modern’ architecture German electrically-operated ones that
– and none to housing estates, today’s cost a fortune. So, he asked me if I could
TH I don’t – I rarely work to more than closest equivalent to a village. In my 20s, come up with a simpler idea. So, really,
.02 mm (the resolution of my lathe and I made some furniture and often tried to the answer to your question is that once
mill DROs). At university, in 1970, I was cut everything with a jig-saw (avoiding someone has a body of work, no one asks
taught about tolerances and told not to using a table or bandsaw) just so, when to see their qualifications. I do actually
specify more precision than necessary you run your finger along an edge, it have an engineering degree, but no one
because it added cost. With today’s CNC feels uneven and handmade. has asked to see it.
tools, this is less important and


designers often lack the practical HS Is that something you’d offer
experience to know what Once someone as advice to home- and shed-
tolerance is needed for a part, so
has a body of based makers? And what’s the
specify tight tolerances just to best way to build up that body of
be safe. work, no one work, and make sure it attracts
asks to the right eyeballs?
HS “Builders use laser levels to see their


make walls and floors accurately TH It wouldn’t work for most
vertical and horizontal because it qualifications people. But it can for anyone
saves time – there’s less who’s driven to pursue stuff that
measuring to do. This is partly interests them, rather than to
why it’s often cheaper to knock down an HS How did someone with no make the most money. For them, my
old house and build a new one, rather apprenticeship or degree end up being advice is simply don’t give up – it
than to restore the old one.” trusted to design gates to separate tigers always takes longer than you think.
This is something I’d never thought from delicious, meat-based members of
about before. We’ve obviously gained a the public? HS Many of our readers will know you
lot through increased accuracy, but do already from The Secret Life of
you think we’ve lost anything in TH I’d made an elaborate clock for the Machines [at this point we’d direct
the process? zoo a few years before, and became anyone who hasn’t done so already to go

42
m kin
LENS

n Above
The Secret Life of
Machines explores
the technology that’s
all around us

Left
Each episode of
The Secret Life of
Components dives
into things you’ve
probably never
thought of. Imagine
what life was like for
makers before we
had standardised
screw threads,
for example?

43
m
Tim Hunkin

i
INTERVIEW

T n
RIght
Prototyping is
perhaps the area of
making we
enjoy the most

44
u
m kin
LENS

to YouTube and watch every single of space so, when I heard Cabaret was
episode of Tim’s series, The Secret Life moving from Falmouth to London, I got
Of Machines, swiftly followed by The in touch.
Secret Life of Components – for most
people, they’re better than an HS How do people react when they see
engineering degree]. Would it be possible Novelty Automation? Loads of people
to make The Secret Life of Machines spend their time staring at screens, I’d
today, or are modern devices too imagine that even though the technology
boringly dependent on electronics? is old, many of your visitors won’t have
seen anything like it before.

n
TH I’m often asked, or encouraged, to do
an update with today’s machines. The TH At first, most people were baffled by
problems with today’s machines are that Novelty Automation and we lost money.
there’s less to point a camera at, and that Fortunately, after a year or two, Atlas
hacking into the software would be an Obscura got interested, which led to
essential ingredient, but I don’t have the more videos and publicity. Now people
skills or interest to do it. know about the place, it’s a great
advantage being different from anything
HS There’s something Hogarthian about


a lot of your automata, in the way it
pokes fun at the world around us. Do you The problems
see yourself as a mechanical satirist?
with today’s
TH I’m quite happy to be described as machines are
that, and I am also a huge Hogarth fan. that there’s
But there is another strand that’s less to point a


important to me, which is the
importance of working with your hands. camera at
There are far too many people who
spend their lives preaching about their
pet subjects, so I prefer just to else. It’s also fortunate that the short
demonstrate what’s possible. videos visitors take of each other using
the machines are perfect for TikTok. 
HS If I’m reading your website right, you
made your first automaton in 1980, for HS Do you have a favourite Secret Life,
Cabaret Mechanical Theatre in Covent whether Machines or Components? If
Garden. Did they approach you, or the so, why?
other way round? What did that first
automaton do, mechanically? TH I do have a favourite arcade machine
at the moment, ‘Trust Wildlife?’ I spent
TH Actually, I started making over a year making it, and had no idea
automatons when I was a kid. I think I what it would be like until I added the
made ‘Gladys the burglar catcher’ when I sound track in the last month or two. I
was 14. As a teenager, I loved London’s used my own voice, greatly improved
many surplus shops and made bits of with Adobe Audition, which was fun. But
‘kinetic art’ thinking they were more really, why I like it is that, a few months
sophisticated than my earlier machines. after putting it on the pier, I was showing
But when I moved to the country, and got a couple of visitors around and, while
my workshop in my late 20s, I returned they were inside, I realised something
to making automata, all out of wood at that had never occurred to me before
first. I used to take them to the local fairs – the seagulls say pretty much exactly
and steam rallies. But they took up a lot what I think of the world.

45
In the workshop: Four-digit display

FEATURE

IN THE
WORKSHOP:
Four-digit display
By Andrew Gregory Working with a cheap (in terms of money
– not in terms of time) display

A
while back, I bought a four-digit,
seven-segment display, hoping to
put it into a clock, or perhaps a
simple counting device. I’d
expected to be able to connect it
with power, ground, and two data
wires, but this display has 16 pins, none of them
labelled. I would not be able to simply plug this into
a Raspberry Pi Pico and throw MicroPython at it.
Before I even get close to programming with this,
I’ll need to wire it up. There are plenty of tutorial
examples on the internet of wiring a four-digit,
seven-segment display with dots between each digit
(8.8.8.8.), but I couldn’t find any for the version I
have, with two extra characters and two extra
pins (8.8.:8.’8.).
Some electrical components are unidirectional,
such as diodes (including LEDs) and electrolytic
capacitors. These components will have one leg
Above
The letters YS are longer than the other to denote which way round it’s
the only identifying
marks on this display
supposed to go, or will have a handy + and - printed
on them. This display has none of that. I’m going to
Right
No numbers on any have to find which pin is which through trial and error.
of these pins. We’re Now, to the bench power supply. The part’s
just guessing here
datasheet mentions an optimal current of 20 mA; I’ll
halve that at first and increase it later if I need to. As
for voltage, if this is going to be any use at all to me,
it’s going to have to run off 3 V power from a
Raspberry Pi Pico. So, with 10 mA and 3.3 V dialled

46
LENS

Left
Move the ground
wire along a pin and
the illuminated LED
changes. Through
trial and error, we’ve
worked out that the
yellow wire, which is
carrying 3.3 V, must
be attached to pin 2
in the pinout

into the power supply, and (to be doubly safe) a 1K


resistor to ward off the magic smoke, I started the
I ran power
process of trial and error.
With the bottom-left pin connected to ground, I
ran power through each of the eight pins along the
through each of
top of the display one at a time, repeating the
process with the bottom second-left pin connected
to ground, all the way through to the bottom-right
the eight pins
pin connected to ground. None of them worked.
Undeterred (well, slightly deterred), I remembered
that LEDs only work in one direction, so I turned the I moved the 3 V wire along one space, and tried
display around on the breadboard and tried again. again moving the ground. No LEDs lit up. But
Success! With 3 V going into the now top-left pin, something exciting happened when I moved the 3 V
attaching ground to the third from left on the bottom wire along one more hole: moving the ground wire
pin lights up a single LED. Move ground along two along the pins now lit up segments in a different
pins and a different LED in the same digit lights up; digit. With this success, I added another wire, this
move ground along one more time, and a different time connecting ground to a different pin on the top
LED lights up. row of the display. With this, a decimal point lit up.

47
In the workshop: Four-digit display

FEATURE

RIght
Move the ground
wire along two pins
and the affected
digit changes

Below
DIG1–4 probably
refers to the four
digits of the display.
For anything else, we
need to dig deeper

48
LENS

Left
It’s a scary-sounding
term, but what I’ve
done here is some
extremely basic
reverse-engineering

What this muddled approach tells us is that some


pins are used more than once to display a single
character. This makes sense, because the display only
has 16 pins, while there are 34 LEDs in the display.
Some pins are
Armed with this knowledge, we can make more
sense of the pinout on the datasheet. The pinout used more
than once
diagram has annotations 1 to 16 (though not in order,
which is what foxed me at first); these will
correspond to the 26 pins on the display. By
changing the position of the pin that gets supplied
with 3 V, we can change which digit contains the
LEDs that get lit up; referring to the pinout diagram, LESSONS LEARNED
we can make an educated guess that we’ve just The moral of this story is that you should always
identified pins 1 and 2 on the display (we’ve also check before you buy that the documentation
identified that pins 1 and 2 aren’t next to each other). you need is written in a language that you can
Or, at least, I think that’s what’s happened: it’s hard easily understand.
when nothing is in English, nothing is labelled, and The other moral is that all this can be avoided if
numbers aren’t in numerical order. you just spend a few more pennies and buy a
By the way, if you search for this yourself, you’ll module that elides the complicated bits for you.
probably find a load of tutorials for using a similar You’re not a huge manufacturing conglomerate for
display that only has four pins; this is the TM1637 which a saving of 20p per component will add up to
module, which uses I2C to abstract the wiring to a millions in shareholder value; you’re making one, or
single connector and the programming to just one two, of half a dozen things in your precious spare
Python module. For future reference, this is the time and, if spending a tiny bit more money can save
smart choice. you hours of fiddling, it’s well worth it.

49
200 PAGES OF RASPBERRY PI
QuickStart guide to setting up The very best projects built by
your Raspberry Pi computer your Raspberry Pi community

Updated with Raspberry Pi Pico Discover incredible kit and


and all the latest kit tutorials for your projects

Buy online: magpi.cc/store


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

58
RECYCLE
PLA
Use your old 3D prints
in new builds
PG
52
64
PG
SCHOOL OF
GETTING STARTED WITH
MICROCONTROLLERS
Take your first steps with
MAKING
Start your journey to craftsmanship
programmable electronics with these essential skills

PG 52 KiCad
68
POLYCARBONATE
A challenging filament for
challenging environments

PG PG
70 76 PG

BLUETOOTH PLANETARY 80
KEYBOARD GEARS MACRAMÉ
Customise your computer Compact drive chains that How do you make things
with a Raspberry Pi Pico W are easy to 3D-print with string? We can knot
KiCad libraries, symbols, and footprints

SCHOOL OF MAKING

KiCad libraries, symbols,


and footprints
In this third part of a series of articles around PCB creation with KiCad, let's look at adding
or importing custom libraries, schematic symbols, and component footprints

I
n the first two parts of this KiCad series, going to go step by step through the making of this
we’ve covered enough to make a basic board, but the project files are available at hsmag.
PCB suitable for simple circuits, or maybe cc/issue68, and the knowledge and techniques
a breakout board. In this part, we are we used in the first two parts of this series, in
going to look at some next steps that open combination with this section, should give you
up the capabilities of what you can make enough knowledge to recreate this project.
Jo Hinchliffe in KiCad. We’ll explore both creating libraries and We’ve chosen to use a Solder Party Stamp and
contents from scratch, but also importing and using a Pimoroni BMP280 module connected together
@concreted0g
component footprints and schematic symbols so that the resulting board can be used to measure
Jo Hinchliffe is a
from other sources. We’ll also improve the quality and log temperature and barometric pressure. The
constant tinkerer and of the boards by using flooded areas for common Solder Party Stamp is an excellent board that has
is passionate about all connections, such as all the circuit points that are an RP2040 at its heart, and is operationally similar
things DIY space. He
loves designing and connected to ground. to a Raspberry Pi Pico. The RP2040 is fully broken
scratch-building both We’ve used a relatively simple design to show out to header pins which are castellated, so you
model and high-power
these techniques – making a PCB that essentially can also solder the Stamp onto a recipient PCB's
rockets, and releases the
designs and components has two modules on board. Quite often, when pads without having to use header pins. The Stamp
as open-source. He also making, we work with electronics modules on also has the USB connection broken out as well as
has a shed full of lathes
and milling machines
breadboards and a custom PCB can be the perfect on-board LiPo charging. This means if we add a USB
and CNC kit! way to take a breadboard project to a permanent connection, we can also add a LiPo cell and make
home that’s more rugged and usable. We aren’t the project stand-alone. The Solder Party Stamp is
really well-documented and is open-source. Solder
Party has also published KiCad schematic symbols
and a PCB footprint for the Stamp, therefore we can
use it to learn how to add libraries and import these
useful items into KiCad.
To begin, go to the following link where you will
find the Solder Party Stamp library components:
hsmag.cc/StampFootprints. Click the drop-down
menu on the green Code button and then select
the Download ZIP option to download the libraries.
Right Unzip the files somewhere on your machine. In
Our completed board,
ready to receive a the collection of folders you just unzipped, cut and
Solder Party Stamp paste the entire KiCad folder (N.B. not the KiCad 5
and a Pimoroni
BMP280 module folder) to wherever you want to store your additional

52
FORGE

QUICK TIP
In the project
schematic, we
have sometimes
used net labels to
create connections
between symbols
rather than direct
drawn wires.
We’ll cover this in
some detail in an
upcoming article.

Figure 1
The Symbol
Libraries dialog
where we can add or
remove schematic
symbol libraries


external KiCad libraries. We have a folder set up in
our home directory for this.
If we add a USB
Open KiCad 7 and, in the main page, click the
Preferences drop-down menu and then select the connection, we can also
Manage Symbol Libraries option. This should open add a LiPo cell and make


a window with two tabs: the Global Libraries tab
and the Project Specific tab, (Figure 1). Ensuring the project stand-alone
you are on the Global Libraries tab, find and click
the small folder icon. Navigate to the folder we
downloaded, extracted, and copy-pasted and open folder icon (Figure 2). Navigate to the folder we
it to find a folder called KiCad_stamp_lib. Open downloaded and find KiCad_stamp_lib – open that
this folder and select RP2040_Stamp.kicad.sym folder once more but, this time, select the RP2040_
and then click Open. You should now see a new Stamp.pretty folder and click Open. You should see
library listed at the bottom of the Global Libraries tab three files inside, but you don’t need to select any
called RP2040_Stamp. If you create a new project particular one – just click Open again. Now, back on
and open the Schematic Editor, you can now use the Global Libraries tab, you should be able to scroll
the ‘Add a Symbol’ tool to place a Solder Party down and see an RP2040_Stamp library entry. You
Stamp symbol into the schematic. You can do this can check that this has all worked by associating
by searching for RP2040 and making sure you select the correct stamp footprint to the RP2040_Stamp
the symbol from the RP2040_Stamp library (rather symbol we placed in the Schematic Editor, and
than the stock RP2040 symbol) or by scrolling down then you can open up and import the part into the
the list of libraries, selecting RP2040_Stamp, and PCB Editor. If you need a reminder on how to do
then selecting the RP2040_Stamp symbol. those tasks, check out the first and second part of
It’s a similar experience to add a footprint this series in HackSpace #67 (hsmag.cc/issue67).
library. Again in the KiCad landing page, click Using the BMP280 module gives us an
Preferences and then Manage Footprint Libraries. opportunity to learn how to make both a custom
Again, on the Global Libraries tab, click the small schematic symbol and a custom footprint for the

53
KiCad libraries, symbols, and footprints

SCHOOL OF MAKING

Figure 2
The Footprint
Libraries dialog
where we can add or
remove PCB footprint
module libraries

module to use in our board. To do this we will create then click OK. You’ll now be asked to give your
our own custom libraries to contain these parts, library a name – it can be anything you want, so
and others in the future. Let’s begin with a custom name it, making sure to leave the ‘.kicad_sym’ part
schematic symbol. In the Schematic Editor, click the of the file name intact, and click Save. You should
‘Create, delete and edit symbols’ tool button. This now see your new symbol library name highlighted
opens the schematic Symbol Editor. on the left-hand side of the Symbol Editor window.
In this new window, click File and then select New This means that this is the active library, so that
Library from the drop-down menu. You should now when we select to create a new symbol, it will be
see a small dialog box called Add To Library Table. stored in this library automatically. Click File and
In this box, you can select to add your new library select New Symbol… from the drop-down menu.
to the Global table. This means any project in KiCad You should see a New Symbol dialog appear. Give
can access this library; alternatively, selecting Project your symbol a name that will be used in the library
Figure 3
The Symbol Editor means only this KiCad project can access that library. list – make it a useful name that reflects the part.
window can be used As the BMP280 is something we might use in other We went for ‘pi_bmp280’. Clicking OK, you should
to create or edit
schematic symbols projects, let's make sure ‘Global’ is highlighted and now see that a ‘U’ has appeared in the Symbol
Editor window and that the name of the symbol
now appears in the active library in the list on the
left-hand side of the screen. The name will have a
‘*’ next to it, indicating that the symbol has not been
saved. In the Symbol Editor there are some familiar
controls, such as the F1/F2 to zoom in and out.
Zoom out a little to give yourself some room and
let’s get started by adding some pins.
Click the ‘Add a pin’ tool icon. In the dialog, we
can name the pin, give the pin a number, and set the
‘Electrical type’ and change other settings if needed.
For our first pin, let’s name it ‘2-6V_in’, assign it pin
number ’1’, and set the electrical type to ‘Power
input’. Continue to add pins 2, 3, 4, and 5, labelling
them as you can see in Figure 3. As you place pins,
notice that you can use the generic hot keys M for

54
FORGE

Figure 4
The Footprint Editor
window can be used
to create or edit
component footprints

move and R for rotate, similar to the Schematic or


PCB Editors. Once you have all your pins created,
you can add a text label using the ‘Add a text item’ Figure 5
Editing the pad size
tool. This is useful so that you can identify the and shape using the
symbol quickly when looking at a schematic. Finally, Pad Properties menu

let’s draw a bounding box around our schematic


symbol so that everything is neatly grouped
together. Click the ‘Add a rectangle’ tool, and draw
a rectangle over your design. Click the Save icon

” Give your symbol a name that


will be used in the library list do is to click File and then select New Library from
– make it a useful name that the drop-down menu. Again, you can select to add


a new library to the Global or Project table – select QUICK TIP
reflects the part Global and name your library. Once the new library Note that if you
appears in the list, highlight it and then click File use a schematic
and select New Footprint. A dialog appears and symbol or a footprint
in the top-left corner of the screen, and then close we can name our new footprint. We called ours module from an
external library,
the Symbol Editor window. You can now go into the ‘Pim_BMP280_Module’.
once it is saved in
Schematic Editor and use the ‘Add a symbol’ tool to We also need to select from the drop-down
your KiCad project
find and add your first custom symbol. menu whether this is an ‘SMD’ or ‘Through Hole’ file, the symbol/
Next, we need to make a new footprint library component. Selecting ‘Through Hole’, we are footprint is stored in
and footprint for the Pimoroni BMP280 module. To now ready to add the pads and other parts of our that project. If you
begin, we first need to open the Footprint Editor footprint. Similar to the PCB Editor, we can set the moved to another
(Figure 4). This is available either from the main grid resolution and, as the pins on the BMP280 machine with KiCad
that didn’t have the
KiCad project window, or indeed can be launched module are spaced at a standard 2.54 mm pitch,
custom libraries
from the ‘Create, delete and edit footprints’ tool icon it is worth setting the grid to this initially to allow added, you would
in the PCB Editor. Similar to the Symbol Editor, once us to easily place the pins. Next, click the ‘Add a be able to open the
you have the Footprint Editor open, the first thing to pad’ tool icon. We want to end up with five pads project as usual.

55
KiCad libraries, symbols, and footprints

SCHOOL OF MAKING

QUICK TIP
If you aren’t in the
Schematic Editor,
you can open the
Symbol Editor from
the main KiCad
project window.

Figure 6
Using Inkscape to
create an accurate
graphic for the PCB
edge-cut geometries


labelled 1 to 5 moving from left to right. The easiest
Many components will way to do this is to count two grid spacings out from
the centre datum line and then click to place pad 1.
have physical package Notice that the ‘Add a pad’ tool then increments the
dimensions listed in pad number so the next previewed pad is labelled


‘2’. Move one pad to the right of the pad you just
their datasheet made and click again. Continue to do this until you
have a neat row of five pads.
Reverting to the general ‘Select items’ tool,
hover over pad 1 and press the E key to open the
USB ON BOARD ‘Pad Properties’ dialog (Figure 5). In this window
We’ve now nearly got everything we need to make the Stamp and BMP280 board! You you can change the geometry of the pad, the
might have noticed in the main image that we have added a USB edge connector directly size of the hole, and many more options. We’ve
onto the PCB. This is a cheap and cheerful approach to adding USB without adding any found that increasing the pad size slightly from the
extra components, although we will need to add around 1 mm of material to the back default, and increasing the hole size, works well for
of the 1.6 mm thick PCB in this area to actually make the USB connector fit. The reason
soldering header pins between modules. You may
we added this is to highlight another way of using libraries and components from other,
have your own preferences, but we edited each
suitably licensed, KiCad projects. In this example we found a project, the USB Armory,
which, in an early Mk1 version, used the USB edge connector on PCB approach. The pad to be a 1.8 mm circle with a 1 mm hole. With
USB Armory is an open-source project and we can download the project repository here: the pads created, we next need to add a silkscreen
hsmag.cc/USBArmory. Once downloaded, unzip the folder and use KiCad to navigate to item that represents the physical area the module
the hardware folder, then mark-one, and then open the file armory.kicad_pro. Once open, will occupy. Many components will have physical
move to the PCB Editor and select the USB edge connector footprint and press E. In the package dimensions listed in their datasheet, but
Footprint Properties window, click the Edit Footprint button. This should open the footprint
that’s not always the case with modules that are
in the Footprint Editor. You might get a warning that the footprint was made with an earlier
version of KiCad, but saving the footprint in the editor should clear this warning. You should really designed for prototyping and breadboard use.
see that the footprints pads and the silkscreen line (which doubles as a guide for the edge In these cases, some investigation with a pair of
of the PCB board cut out) are now opened in the Footprint Editor. Across the top of the callipers is a good approach to get some dimensions
editor you should see a warning that you are currently only editing the footprint within the of the package. Measuring the Pimoroni BMP280,
current project. You can use File then Save As to rename and save this footprint into your we realised a 19 mm square area with the pin pads
custom library that we created earlier. As that library is created on the Global table, this
2.54 mm from the edge gave us a slightly oversized
USB edge connector footprint is now available to use in any project. We edited our version
a little, labelling the pads more clearly, and saved it to our library. Making a note of each
and therefore safe margin for the module. Select
pad's connectivity, we then repeated the earlier approach to create a custom symbol in the ‘F.Silkscreen’ layer on the right-hand side of the
our library to represent the USB connector in the schematic. screen and then use the ‘Draw a rectangle’ tool to
draw this and position it correctly. Finally, let's add

56
FORGE

File dialog, you can navigate to the file and select QUICK TIP
the working layer to import to. Setting the graphic Note that the
layer as ‘Edge.Cuts‘, notice that we can also set an schematic symbol
Import Scale value. In this instance we designed the pin numbers
board outline to be the correct size in Inkscape, so directly link to the
we leave the import scale at 1.00 so that it imports assigned footprint
pad numbers, so
at its original size. This function is useful. However,
you must make
if we have an oversized graphic or logo to import to
custom symbols and
a silkscreen layer, like the HackSpace logo, we’ve footprints match.
reversed in Inkscape and then imported it onto the
back silkscreen layer. We’ll look at creating PCB
artwork and components in Inkscape in more depth
later in this series.
Finally, another technique that we've used on this
board is to create flooded copper zones attached to
a net label. This is an excellent way of automatically
connecting groups of common connections (see
Figure 7). You can create complex systems with lots
of different flooded areas with differing connectivity,
but in this project we have just used one flood on
the front copper surface that connects all pads
attached to ground. To do this, once the board is laid
out, we used the ‘Add a filled zone’ tool. When you
select this tool, you then left-click to start to draw a
fill area over your board design, ensuring you are on
Figure 7
Flooding the board to connect all the GND connected pads the correct layer. A dialog appears and you can select
the net connection from the list, so we selected
another square on the ‘F.Courtyard’ layer that sits ‘GND’ (Figure 8). Leaving all the other settings at
just slightly outside the silkscreen layer square we the default values, we drew a rectangle over our
just created. You can achieve this by setting the grid board. Don’t worry too much about accuracy as the
to a very small spacing value such as 0.01 mm and flood will only appear inside the edge-cut geometry.
then drawing a rectangle away from the silkscreen Drawing three points of your rectangle you can
rectangle to avoid it snapping. Make the new square then right-click and select ‘Close outline’ from the
19.4 mm and then you can use the M key to move drop-down menu. The rectangle (or other shape you
the square into position. This new square in the drew) should now flood, and you should see that
front courtyard layer provides a service called the all the previously disconnected GND pads are now
‘DRC’ or ‘Design Rules Checker‘ with a boundary connected together – neat!
that shouldn’t be overlapped. This means that later
in the process, if a component is overlapping, this
boundary on the PCB when we run the DRC will be
highlighted as an issue. We’ll look at using the DRC
in the next part of this series.
To create the board outline, we decided to not
use the graphical tools in the PCB Editor but, rather,
we imported an outline we drew in the free and
open-source Inkscape application (Figure 6). Whilst
the included KiCad tools are excellent, Inkscape
can offer some advantages when designing graphic
components. We drew a simple outline object
for the board in Inkscape, saved it as an SVG file,
Figure 8
and then imported it into KiCad. To do this, click Selecting the net
File and then select Import > Graphics… from the from a list to which
the flooded copper
drop-down menus. In the Import Vector Graphics zone will connect

57
Recycling PLA

TUTORIAL

Recycling PLA
Turn filament scraps into beautiful new objects

Ben Everard
@ben_everard

Ben’s house is slowly


being taken over by 3D
printers. He plans to
solve this by printing an
extension, once he gets
enough printers.

L
et’s be honest, if you have a 3D are a few projects that attempt to do this, either by
printer, you probably generate quite reforming scrap PLA into filament, or by making an
a bit of plastic waste. There are ways extruder that can be fed with shards of plastic rather
to minimise this – and you absolutely than a spool of filament.
should – but you can’t eliminate it There are a couple of key problems you have to
entirely. There will always be some failed overcome. The first is that you need quite a bit of
prints, and sometimes the first version of something equipment. At the very least, a shredder to break up
you’ve designed isn’t perfect (and neither is the the plastic, and an extruder to melt this plastic and
second, third, or fourth). Can we reuse this waste squeeze it through a nozzle (either on the printer
plastic rather than throw it away? itself or to make new filament). Both of these are
Above & Right
In some early tests, This project started because of an off-hand reasonably costly machines. Once you’ve got the
we ended up with comment in our local hackspace: “Wouldn’t it be stuff, it’s a fairly time-consuming process. And finally,
very blocky colours,
but we fixed this by nice if you could feed failed 3D prints back into the if you get any particles of metal or anything that’s not
remelting the sheet printer.” This is something that comes up fairly PLA in the mix that are larger than 0.4 mm, then you’ll
and using the fold-
and-twist method regularly in the 3D printing community, and there jam your nozzle when you try to print it.

58
FORGE


Overall, it’s not impossible, but it’s not entirely
trivial, and the amount of effort is quite large to create We’ve finally come to the conclusion that you don’t


a spool of filament that you could buy for under £20.
The project almost died there until we realised that actually need to break up the plastic in most cases
the 3D printer isn’t the only machine that we used
plastic in. We also used acrylic sheets in the laser
cutter. What if, instead of making PLA filament for the
3D printer, we made PLA sheets for the laser cutter?
SAFETY
We’ve got a heat press (for pressing vinyl and Plastics give off fumes when they melt. Some give off
sublimation prints onto fabric), which should be able more dangerous fumes than others, and some give off
to squeeze soft plastic into a sheet if we can work out more than others.
the appropriate settings. Obviously, this includes your 3D printer. However,
First, though, we needed some scrap PLA. We left we’re melting a lot more plastic a lot quicker than you
do on a 3D printer, so it’s going to give off more.
a box in our local hackspace asking for donations, and
Most of the fumes given off by PLA aren’t known
they quickly turned up. Last month we also spent a to be particularly toxic, but there’s a lot unknown
long time testing the Prusa MK4, and that meant a lot about exposure to these sorts of chemicals. The risk is
of printing. While we try to test printers with useful increased significantly if you do this regularly.
prints, there are only so many things we need, so a There are a few things you can do to increase
large number inevitably end up as scrap. your safety. Most obviously, you can increase your
ventilation – open a window and ideally point a fan
There are a lot of variables to tune, but the first
at it to increase airflow. You can also work with the
ones were part size and temperature.
coolest possible temperatures. PLA emits a lot more
Part size affects a few things – mainly aesthetics fumes once temperatures get to around 200°C.
(more on this later) and how fast it melts. We don’t Finally, you can wear a respirator. It needs to be
have a shredder, so getting small parts is mainly a both correctly fitting and rated for filtering volatile
case of using pliers, a vice, a bandsaw, and a hammer organic compounds (VOCs) to be effective.
in various combinations to break up bits into smaller The exact combination of measures you need
will depend entirely on your setup, so it’s up to
pieces. After much sweating and swearing, we’ve
you to understand the risks if you choose to follow
finally come to the conclusion that you don’t actually this method.
need to break up the plastic in most cases. The best

59
Recycling PLA

TUTORIAL

solution is actually to blast it with a hot-air gun until


it’s soft enough for the initial squish in the heat press.
We found that we got reasonable results
between 180°C and 200°C, with the optimal being
around 190°C.
To protect the press, we used baking sheets on
both sides. Our press only heats from the top, so
we had to periodically flip it to ensure it melts from
both sides. Once it’s been squished to the desired

” Blast it with a hot-air gun


until it’s soft enough
for the initial squish in the
heat press

thickness, take it out and place it under something
heavy to keep it flat while it’s cooling (we found that a
Above & Right few hefty books worked well).
We love the The result is a fairly flat sheet that laser-cuts
combination of black
and orange, but it reasonably well.
wasn’t really working As a general method, this works, but it has a
until we tried the
swirl pattern couple of problems:

60
FORGE

1) depending on the parts you started with, you can


get a lot of bubbles trapped in the sheet
OTHER PLASTICS?
2) the colours can be very blobby, and it’s not the We’ve focussed our efforts on PLA because it’s the most popular plastic for 3D printing,
most aesthetically pleasing effect. but any plastic that can be printed with an FDM printer is a thermoplastic that can be
The solution to both of these problems is to mix the heated and reformed. Should you give this a go with other plastics?
plastic a bit more. For this, you’ll need some heat- Firstly, you need to think about safety. Different plastics give off different levels of
proof gloves. We’ve tried leather work gloves and fumes, and these have different levels of toxicity. We would recommend staying away
from ABS and nylon unless you are confident in your setup.
silicone oven gloves and both work fine. The only ones
PETG might be worth experimenting with if you have enough to try. You will, however,
we’ve had trouble with are work gloves with some need to work at hotter temperatures.
sort of flexible rubber grips on them which melted into Obviously 3D prints are not the only source of plastic that can be recycled. We’ve
the plastic. seen other makers have success with similar techniques using HDPE (high-density
To get rid of the bubbles, simply folding and twisting polyethylene) – you can recognise this as it has a number 2 inside the recycling sign.
the plastic a few times seems to work well. This However, we’ve not experimented with it.
might feel like it’d introduce air, but it really doesn’t.
If you’re just here to create functional parts, then
you can finish here. You should have some reasonably the pattern doesn’t really matter, it’s not going to look
consistent, smooth sheets that you can laser-cut. good. You can either hold onto the PLA until you have
They’re also easy to work with using hand tools some more colours, or you can use them to create
as well. functional parts or test pieces that don’t have to
Beauty is, as they say, in the eye of the beholder, look good.
and what we find interesting might not be what We found two ways of creating interesting-
you find interesting. That said, there are some looking prints.
basic techniques that you can use to create an The first is to have a roughly even mix of two
interesting look. colours to start with. You can then melt these down
The first and most obvious thing is to think about to a sheet with the colours separated – one colour
your colours. If the colours don’t work together, then on one side, the other colour on the other side. You
can still mix this up a bit to get the air bubbles out by
folding into the middle or perpendicular to the split in
the colours. Once everything’s fully soft, it’s time

Left
A quick blast with a
hot-air gun can really
make your bowl shine

61
Recycling PLA

TUTORIAL

COMPOSTING
In theory, PLA is compostable. However, the brutal
truth is that it’s almost impossible to compost it. If you
try, you may well be making the situation worse. We
would strongly recommend that you don’t attempt to
compost PLA unless you are very familiar with the
specifics of both PLA and the system you’ll be using.
PLA will break down in very specific conditions
(basically, it needs to be held at over 60°C for an
extended period of time). Doing this on a home
compost heap isn’t impossible, but it is hard. And
you need to ensure that all of the PLA is held at that
temperature. If you fail to fully compost the PLA, your
compost will be full of half-decomposed microplastics
that you’ll be contaminating the environment with.
There are some industrial composters that do
meet the requirements of composting PLA, but it’s
by no means all of them. You can’t just assume that
you can add PLA to a food waste collection and it’ll
be dealt with. In fact, you might make the situation
much worse – if the composters aren’t expecting PLA
in the waste, they may reject an entire batch of food
waste and send it to landfill to stop their compost from
being contaminated with plastic. If you do want to
compost your PLA, it’s imperative that you speak with
the waste company to ensure that they will process
it, otherwise, you could find that you not only don’t get
your PLA composted, but that you stop a lot of other
compostable waste from being composted.
What should you do with PLA? Well, it’s
complicated. Take a look at the safe disposal box for
more information.

The second technique requires smaller pieces with


a very mixed range of colours. Mix them as evenly as
you can before you melt them and only mix a little to
break up the bubbles.
Those are the two effects we’re particularly
to mix. Roll it perpendicular to the colours, then fold pleased with, but that’s just our personal style.
it over and twist to swirl the colours together. How At this point, we had a technique for generating
much twisting takes a bit of practice to get right. Too some interesting-looking PLA sheet, and had done
little and it’s still very some initial tests laser-


blocky. Too much and cutting them. However,
you just mix the colours the laser cutter chiller at
together and end up
Get it right and Bristol Hackspace had
with something fairly you can generate some a ‘bang and spark’ error
brown. Get it right and that took out the power
really interesting


you can generate some to the building and
really interesting swirly swirly effects hasn’t worked since. A
effects. The amount of new one’s on order, but
mixing you want is often we want to do some
dictated by the size of the thing you’re making. If your more testing before talking more about laser-cutting
Above
Before the laser final objects are small, you’ll want a tighter, smaller this material.
cutter broke, we swirl. If they’re bigger, you might want a loose swirl. Fortunately, though, there’s more than one way to
tested out some
jewellery designs There’s no real substitute for experimentation here. work with sheet PLA, and we’ve been experimenting

62
FORGE

with slump-moulded bowls. The idea is really simple.


Take an upturned bowl, or similarly shaped object.
Below
Heat up a sheet of PLA until it’s soft. Plonk the PLA You can see in the
on the upturned bowl and it’ll sag down to make a texture of the bottom-
left bowl that we
bowl shape. This is very similar to a technique that’s didn’t get the
bubbles out properly
often used with old vinyl records.
The amount you heat the PLA sheet affects the
final result. If it’s very soft, it’ll instantly drape over
the bowl, and you may find some of the pleats fold
together. If it’s only a little soft, you can get a gentler,
more open bowl. There’s no right or wrong here, it’s
just a matter of what you prefer.
This technique works best if you start off with a
circular sheet of PLA. You can either cut this out of
a different-shaped sheet, or you can make a circular
sheet by depositing a roughly circular blob of PLA in
your press after twisting and mixing it.
You can use a heat gun to make minor changes to
the shape of your bowl as it cools.
The final thing to give your bowl a glossy
appearance is ‘flame polishing’. This is where
you melt the outer layer of PLA and let it smooth
together to create a shiny finish. While this is called
flame polishing, it’s best to do this with a heat gun.
Experiment a little to find the temperatures and flow
rates that work best for you, as this will vary a bit
between heat guns, and you can also get different
effects, from a satin finish to a high gloss.
From a fairly innocuous discussion, we’ve been
down a rabbit hole of plastic recycling and ended
up with a technique for generating PLA sheet that’s
easy to work with and can look great. We’re going
to further test this technique and this material to see
SAFE DISPOSAL
what we can do – we’ll report back with our findings
If you can’t compost or reuse your PLA, what should you do? The answer really depends
in future articles. on what your local waste system looks like, and it’s impossible for us to give hard-and-
fast rules. For example, this author has a different waste stream at home and in the
office, and the waste is processed slightly differently.
At home, he has domestic plastic waste. PLA isn’t often recycled commercially
Below
A pile of PLA scraps waiting to be pressed into a sheet because there isn’t a lot of it in the waste stream. Even if it was, it’s pretty hard to get
3D prints to be recognised correctly. You’ll need to label them, and ideally, test this label
with a plastic sorter.
However, the particular plastic recycling plant that is used by this author’s waste
collection team has two parts to it. Firstly, it recycles any recyclable plastic. Secondly, it
incinerates non-recyclable plastic and uses this to generate electricity that both powers
the recycling plant and feeds back into the grid.
In this situation, the PLA (which is plant-derived, not oil-derived like most plastics)
essentially becomes a biofuel that happened to be a 3D print along the way. That doesn’t
necessarily make it great for the environment, but at the same time, it doesn’t seem
too bad.
In the workshop, the general waste goes directly to a different waste-to-power plant,
so PLA should go directly into this, and again, it will be used as a biofuel.
This, however, is the author’s specific setup. Your waste streams will be different,
and you’ll need to familiarise yourself with where different bits of waste end up to know
where the best place to put your PLA is.

63
Beginning electronics: Introduction to microcontrollers

TUTORIAL

Beginning
Part 02

electronics:
Introduction to
Stewart
microcontrollers
MAKER

Watkiss Learn about microcontrollers using Raspberry Pi Pico. Build a motion sensor
Also known as which turns on LEDs whenever someone enters a room
Penguin Tutor.
Maker and YouTuber

I
that loves all things
Getting started with the Pico
Raspberry Pi and
Pico. Author of
n this project, you will learn how to detect
when someone enters a room using a PIR
02 To be able to insert the Pico onto a
Learn Electronics (passive infrared) motion sensor. You will breadboard you’ll need pins soldered to it. You can
with Raspberry Pi.
learn how to use MicroPython to carry out actions solder headers on yourself, or you can buy versions
penguintutor.com based on the PIR sensor. The code can make of the Pico with the pins pre-soldered. With the
twitter.com/ decisions and set an output. This can be used to headers in place, you can plug the Pico into a
stewartwatkiss turn on LEDs. You’ll also learn about schematic breadboard ready for adding other components.
circuit diagrams, making it easier to understand You’ll also need to install MicroPython onto
how a circuit works. the Pico. Download the appropriate UF2 file
from magpi.cc/micropython. Hold down the
You’ll Need BOOTSEL button whilst connecting the Pico to
your computer. Drag and drop the UF2 file to the
What is a microcontroller?
> Breadboard
magpi.cc/ 01 A microcontroller is an electronic device.
RPI‑RP2 drive that appears on your computer.

breadboardhalf It is a type of computer, in that it runs code to


> PIR motion sensor determine what actions to take, but it isn’t as
magpi.cc/pir The PIR sensor and the GPIO pins
> White LEDs
powerful as your Raspberry Pi computer and does
not run an operating system. The microcontroller
03 A PIR sensor is a device that can detect
magpi.cc/whiteled runs your code directly and is great for using as when someone is nearby. It stands for passive
part of an electronic circuit. infrared and is essentially a heat detector, which
> 150 Ω resistors
magpi.cc/ You’ll need a Raspberry Pi Pico for this project. detects the heat from someone’s body. To prevent
14wresistor Pico uses the RP2040 microcontroller. It’s a low- unwanted triggering, the sensor is split into zones;
cost microcontroller packed full of features. There it only sends a high output when it detects heat
> Jumper wires
magpi.cc/ are versions of the Pico available with wireless moving across the zones.
jumperbumper connectivity, but the standard Raspberry Pi Pico The PIR sensor will be connected to one of the
is fine for this project. GPIO (general-purpose input/output) pins on

64
FORGE

the Pico. These are sometimes referred to as GP


(general-purpose) pins. The GPIO port numbers do
not line up with the physical pin number. See the
Pico pinout diagram (Figure 1, overleaf) for details.

Connect the PIR sensor


04 The Pico uses 3.3 V for the GPIO pins. The
PIR sensor is connected to the USB voltage which
is approximately 5 V, but fortunately the PIR’s PIR detects motion
high output signal is only 3 V, which is safe to use based on heat from
people walking
with the Pico. LEDs connect to the 5 V
past the sensor
The PIR sensor normally comes with male power supply, with resistors
headers. You will need to use male-to-female to ensure the current doesn’t
jumper leads to connect from the breadboard damage Raspberry Pi Pico
to the PIR sensor. Connect the pin marked GND
(ground) on the PIR to the breadboard row they typically drop 3.3 V across them; with a 5 V
power supply, then, we need a suitable resistor to Figure 2 The
breadboard
limit the current to 12 mA.
T he PIR sensor normally Using a maximum of 1.7 V dropped across the
wiring diagram for
the project

comes with male headers resistor and limiting to 12 mA gives 141 Ω, which
rounds up to 150 Ω. These should be wired as
shown in Figure 1 over the page.
connected to pin 3 on the Pico, the VCC (power)
pin to pin 40 on the Pico, and the OUT pin to pin
4 on the Pico. In the diagram (Figure 2), we’ve
Schematic circuit diagram 
Figure 3 A schematic
used the horizontal power rails of the breadboard,
which makes adding additional components easier.
07 One of the challenges with the breadboard
circuit diagram does
not look the same
as how it does on
diagram is that as more components are added, a breadboard, but
it becomes harder to see where each of the device makes it easier to
see which wires
legs and wires go. connect where
Adding LEDs
05 The aim in this project is to create light
when the PIR sensor detects someone in the
room. Ideally this will turn on a bright light, but
that would need more power than the GPIO ports
can provide. So, for now you can use multiple
white LEDs.
One thing to be aware of is that the GPIO pins
can only provide a small current. According to the
RP2040 data sheet, the total across all the GPIO
pins is 50 mA. The highest current mode for an
individual pin is 12 mA. This is not the absolute
maximum, but the output voltage will decrease
when exceeding that current.

Limiting the current through


06 the LEDs
This circuit uses four LEDs; limiting them to 12 mA
will be just within the maximum for the individual
pins and the total for all pins. Using white LEDs,

65
Beginning electronics: Introduction to microcontrollers

TUTORIAL

port numbers. The PIR sensor is also a rectangle,


which in this case includes an image inside to
represent the sensor.
The resistors are represented by small
rectangles. The LEDs are made up of a diode,
which is an arrow followed by a vertical line, and
then two arrows which indicate that the LED emits
light. The line indicates the cathode (negative end
of the diode).

Power connections
09 The power supply connections are shown
through symbols. The arrows pointing upwards
Figure 1 The are used to indicate the positive power connection
location of the port which is connected to 5 V from the Pico. These are
numbers for the Pico
are shown in this all connected.
diagram. Many of There is an alternative way of showing the The ground, or negative, connection is shown
these can be used for
different functions circuit which is the schematic diagram. It involves as a small diagram with the label GND. They are
learning some new symbols and conventions, but all connected.
makes it much easier when creating larger circuits. From the diagram, you can see the pins that are
The schematic diagram for this circuit is shown used on the Pico and how all of the components
THE MAGPI in Figure 3 on the previous page. are wired together. For complex circuits, this is
much easier than trying to follow the wires on the
breadboard diagram.

Understanding the schematic


08 diagram
Start programming
The schematic diagram includes a combination
of boxes and other symbols which represent the
10 To program Raspberry Pi Pico, you’ll
components (see Figure 4). The components first need to connect using Thonny. It may
are then joined by lines representing a wire or connect automatically. If not, then from the Run
This tutorial electrical connection. menu choose ‘Select interpreter’ and choose
is from in The Raspberry Pi Pico is represented by the large ‘MicroPython (Raspberry Pi Pico)’. Select the
MagPi, the official central rectangle, which is a common way of detected port; if running Thonny on a Raspberry
Raspberry Pi representing integrated circuits or more complex Pi, it’ll normally say ‘Board in FS mode’; for
magazine. Each modules. The labels around the outside represent Windows, it’ll be the appropriate USB serial port.
issue includes a
the physical pin numbers, while the labels inside You can write the code in the main window and
huge variety of
projects, tutorials, the box indicate the purpose, such as the GPIO save it to the Pico. If you name the file main.py
tips and tricks to then it will run automatically when your Pico is
help you get the powered on – any other file name and you will
most out of your need to run it manually using the Thonny editor.
Raspberry Pi.
Find out more at
magpi.cc

Control through code


11 The code starts by importing the relevant
modules – the machine module is a standard
S
 elect the Pico MicroPython library for handling GPIO on
and port from the microcontrollers, and the Pin class is used to
Configure Interpreter
menu option. This is represent an individual GPIO pin. The utime module
how the Pico appears
is the MicroPython version of the standard Python
when connected to a
Raspberry Pi time module. It’s used to add delays in the code.

66
FORGE

T
 he Thonny editor can be used to write MicroPython code directly
onto the Pico. Switch to standard mode to see all the options

DOWNLOAD
main.py THE FULL CODE:
> Language: MicroPython magpi.cc/picopir

001. from machine import Pin


002. import utime
003.
004. pir = Pin(2, Pin.IN)
Figure 4 Some common circuit symbols used on 005.
schematic diagrams. There are different standards – these
are based on symbols used by the KiCad circuit designer 006. led0 = Pin(6, Pin.OUT)
007. led1 = Pin(7, Pin.OUT)
The PIR sensor is used as an input and the four 008. led2 = Pin(16, Pin.OUT)
pins for the LEDs are defined as outputs. 009. led3 = Pin(17, Pin.OUT)
There is a function called leds_on() which can 010.
be passed either True or False as an argument. 011. def leds_on (value):
If True is passed, then it turns all the LEDs on; 012. if value == True:
if False is passed, then it turns all the LEDs off. 013. led0.low()
Note that the pin is set to low to turn an LED on, 014. led1.low()
and high to turn it off. This may appear counter- 015. led2.low()
intuitive, but is because the LEDs are connected to 016. led3.low()
the positive supply and the GPIO needs to be low 017. else:
to allow the current to flow into Pico. 018. led0.high() Top Tip
019. led1.high()
020. led2.high() Pico numbering
021. led3.high()
Detecting the PIR value 022. With the USB
12 The rest of the code is contained within a 023. while True:
connector
positioned to
while True: loop, which will constantly repeat. 024. if (pir.value() == 1): the left, the pins
If the PIR gives a high signal to the pin, the value 025. print ("Turning LEDs on") are numbered
is set to 1 and the LEDs turn on. If it has a low 026. leds_on(True) starting at 1 in the
signal, then the value is 0. There is a delay in each 027. utime.sleep (10) bottom left. Along
of the conditions – it is intentionally longer when 028. else: the bottom row
up to pin 20, then
the LEDs are turned on to ensure it stays on for a 029. print ("Turning LEDs off")
from right to left
reasonable period of time when triggered. In this 030. leds_on(False)
along the top row
case it stays on for ten seconds, but if the PIR does 031. utime.sleep (1) from 21 to 40.
not detect anyone, then it checks every second.

67
3D-printing polycarbonate

TUTORIAL

3D-printing
polycarbonate
When the going gets tough, the tough get PC

W
hen it comes to printing cooling, and more even cooling means less warping.
polycarbonate (PC), there’s Whatever you can do to help here will make a
one basic problem – warping. difference. How big the problem will be depends on
Warping happens because as the model. Wide, flat models tend to warp quite a
the 3D print cools, it shrinks. bit, while small models don’t warp so much.
Different plastics shrink in A slightly ironic problem is that polycarbonate
Ben Everard varying amounts as they cool, but the problem with tends to be used for mechanical parts, and
polycarbonate is not that it shrinks a lot per degree, mechanical parts usually have to fit together, so
@ben_everard
but that you have to print it very hot, so it’s got a warping is both more likely and disproportionately
long way to cool. a problem.
Ben’s house is slowly
being taken over by 3D
You generally need a nozzle temperature of around The second problem is the temperature.
printers. He plans to 300°C. The bed temperature should be somewhere Polycarbonate prints hot. There are some blends
solve this by printing an around or over 100°C. In most cases, hobbyist that will print at around 290°C, but many need 300°C
extension, once he gets
enough printers. printers don’t have heated chambers, but at the very or higher. How high can your printer go? The answer
least, you’re going to need an enclosure. The aim here is usually not what temperature your printer
of the game with polycarbonate is to slow down its could possibly reach, but how hot should you get it
cooling, because slow cooling means more even to go. Most printers will have a heater that can
reach these temperatures, however, they also
have parts that may become damaged if you
try to heat it up to this temperature.
A rough anatomy of a 3D printer hot end
is that there’s a block of aluminium called
a heater block. A heater and thermistor are
placed in holes in this, and there’s a tapped
hole for the nozzle. The problem now is how
to mount this on a (usually plastic) extruder
without everything melting. The solution is
a heat break, which is a metal tube, usually
with fins on it and a fan blowing over it. This
Right should hopefully stop heat creeping up into
Small features, like
Benchy’s chimney, are the rest of the machine. However, in order
prone to distortion if
they don’t have time
to help the filament go down the middle of
to cool sufficiently the heat break, there’s usually a PTFE (Teflon)

68
FORGE

tube down the middle. This PTFE will break down


at high temperatures. How high you should push
your printer is then determined by how well the
heat break works, and how willing you are to risk
damaging your PTFE tube (it can give off highly toxic
gases if it gets too hot). Not all printers have this
PTFE tube – printers that don’t are usually advertised
as having an ‘all-metal hot end’.
It is, however, not only the enclosure and the
nozzle that you have to get up to temperature;
you also need a heated bed that can get up to
around 110°C.
The final piece of the puzzle is getting it to stick
(or not stick) to the print bed. Using a glue stick on a
textured PEI sheet is ideal for this.
There are a lot of different blends of
polycarbonate, many of them designed to be easy It’s this performance that leads polycarbonate to be
to print, but in the world of polycarbonate, easy is a referred to as an ‘engineering’ filament. While it is Above
Polycarbonate pushes
relative word. Because of this variation, it’s difficult a bit tricky to print, it’s still easier and cheaper than hobbyist printers to
to give hard and fast milling metal. their limits, but if you


pick the right blend, it
rules for print settings. Another big might be possible
Experiment and see While it is a bit tricky to advantage is its
what works with your temperature stability.
setup and your filament. print, it’s still easier 3D-printable plastics,
You’ll most probably and cheaper than by their very nature,


need a few goes before soften in the heat.
you dial in your settings. milling metal The high-temperature
That’s an awful requirements for printing
lot of hoops to jump polycarbonate translate
through in order to print polycarbonate, but there are directly into its ability to keep its strength when
some really good reasons to put yourself through exposed to heat.
all of that. The first is durability. Polycarbonate Polycarbonate is rarely a filament you reach for
parts are great if you need strong parts that are because you want to print with it. It’s a filament you Below
also durable, particularly if they’re mechanical. reach for when the other filaments in your armoury Polycarbonate can
have excellent layer
don’t have the properties you need. With a bit of adhesion, but warping
coaxing, it is printable on some hobbyist printers, but can cause separation
DRAFT SHIELD be prepared to take a bit of time over it.
if the heat isn’t
well managed

When printing filaments that are prone to warping,


one option is to print a ‘draft shield’, which is a one-
perimeter-thick surround a couple of centimetres
outside your main print. The idea is that this acts as
a sort of mini enclosure and holds some of the heat
in. It’s obviously not as effective as an enclosure,
but could be used alongside one.
However, while we’ve had success using these
with some filaments (such as ASA), we didn’t find
it reliable with polycarbonate. It tended to
disintegrate into spaghetti; however, this might just
be us. If you are having problems with warping, it
might be worth investigating.
In PrusaSlicer, you can find the option to enable
this under Print Settings > Skirt And Brim (you’ll need
to have Advanced or Expert mode enabled).

69
Pico W-powered Bluetooth chord keyboard

TUTORIAL

Pico W-powered
Bluetooth chord
keyboard
Make a chord keyboard that works over Bluetooth

A
chord keyboard is a great way to modeller to create the case. The positions of the
enter text on the move. You can keys and the case layouts are synchronised by
type in text without having to look Python code running inside KiCad and FreeCAD,
at your fingers. This project builds allowing for flexible key positioning and ensuring
on the chord keyboard described in that the holes for the keys match the key positions
Issue 46 of HackSpace magazine, on the circuit board. You can find the designs,
Rob Miles adding Bluetooth connectivity, using a custom along with the C++ source for the keyboard, on
PCB, and making it easy to create a keyboard that the GitHub repository for this project here:
@robmiles
matches your hand dimensions. github.com/CrazyRobMiles/PICO-blue-chords.

Rob Miles has been


playing with hardware
THE PICO ‘BLUE CHORDS’ KEYBOARD TYPING WITH CHORDS
and software since Figure 1 shows left- and right-handed versions You can see the chords used to enter text using the
almost before there was of the keyboard. They can be used to enter text, keyboard in Figure 2. The chord system used by this
hardware and software.
You can find out more numbers, and symbols. The OLED screen displays keyboard was first used on devices produced by the
about his so-called life at the keyboard mode and the last few characters that Microwriter company in the 1980s. There are six
robmiles.com.
were entered, along with the Bluetooth connection keys: one for each finger and two for the thumb.
status. The keyboard is powered by a Raspberry Pi You enter characters by pressing combinations of
Figure 1 Pico W running C++ code. A rechargeable battery keys. Figure 2 shows the chords for the alphabet.
The key positions
have been customised makes the keyboard fully portable. The project uses The keyboard understands chords for text, numbers,
for the author’s hands. the KiCad circuit design tool to create the custom- and a range of symbols. Each of these is selected
His left hand is slightly
larger than his right printed circuit board (PCB) and the FreeCAD 3D by putting the keyboard into one of four modes. You
select the mode of the keyboard using the ‘control’
key at the far left. The thumb moves to this key
to create chords to change the mode. The mode
is displayed at the bottom of the OLED screen.
Documentation for the keyboard and charts for all
the chord combinations are on the GitHub site for
this project. With a bit of practice, you can enter text
surprisingly quickly.

START WITH THE CIRCUIT


Figure 3 shows the circuit design that was created
using KiCad. There are multiple connections for the
displays and the keys, so the same board can be
used for left-handed and right-handed configurations.

70
FORGE

YOU’LL NEED
PCB
There is a custom-
printed circuit
board (PCB) design
available for this
project, although
you can connect
the circuit by hand
if you prefer

Six key switches


The Kailh
mechanical
keyboard switches
work well

Six Kailh switch


sockets for
Figure 3 MX-compatible
Only one switch will be placed in each column mechanical keys
These are soldered
onto the PCB
The circuit has no connections for power supply and
Six keycaps
battery management. A LiPo SHIM for Pico from
Pimoroni (pimoroni.com) was used for these. Once An SSD1306
the design for the circuit was complete, it was time to OLED display
Make sure that
lay out the PCB. you get the
monochrome


version

A Raspberry Pi
The same board Pico W

can be used for A micro USB


cable to link
left-handed and right-


the Pico W to
the host
handed configuration You will need this
for programming
and charging

PCB NUMBER ONE A battery and


Figure 4, overleaf, shows the PCB design that was power supply
The author used
sent to be manufactured. This was the first PCB the
the LiPo SHIM for
author had designed from scratch. It turned out to Pico from Pimoroni
be quite an easy process. You swap between the along with a
Galleon 400mAh
Schematic Editor (where you design your circuit) hard case LiPo
and the PCB Editor (where you lay out your PCB) as battery
you refine the design. For the author, the hardest A case
task was finding the right ‘footprint’ designs for There is a
each component. The footprints tell the PCB design 3D-printable
Figure 2 design, or you can
program what a component looks like on the PCB. put your keyboard
The chords are shown for right-handed use.
For example, the circuit diagram contains a ‘push They are reversed for left-handed use in any box you like

71
Pico W-powered Bluetooth chord keyboard

TUTORIAL

right hand onto the left hand. This was interesting


in practice. It turns out that the author’s brain can
perform this kind of mapping, but it only works if he
doesn’t think about what he is doing. As soon as he
thinks about the keys he needs to press to enter an
‘A’ with his left hand, he discovers that he is unable
to do it. Hopefully this will improve with practice.

NOTHING IS EVER PERFECT


Figure 6 shows the rear of the PCB. The production
Figure 4
Can you spot which process did a perfect job of converting the designs
column of keys was into a board, but the design was flawed. The extra
not connected? The
author didn’t… wires are needed because the author missed off
the connection for one column of sockets and
button switch’, but the switch footprint required wired a display the wrong way round. However, he
was called ‘SW_Hotswap_Kailh_MX’. This is the thinks that it is traditional that the first design of any
footprint for a socket into which the keys are fitted. board should contain mistakes and is proud to be
The socket goes on the reverse of the board and the upholding this.
key connects through the board to it. The socket has
the characteristic shape you can see above on the LIPO SHIM FOR PICO
diagram, with solder pads for the socket connectors. Given the author’s prowess with circuit design, you
This footprint file for this design had to be located will be relieved to discover that the PCB he designed
and added to a library in the project. Then each doesn’t do any of the potentially dangerous power
switch in the circuit diagram was associated with supply management. This is performed by a LiPo
that footprint style. A similar process was followed SHIM for Pico from Pimoroni, which you can see at
to get the footprint for the Pico device. There are the bottom of the PCB in Figure 6. The SHIM fits
also 3D designs for most components, so you can over pins on the Pico and connects to a rechargeable
use these to make a 3D visualisation of the board. battery. It provides an on-off switch, white power
The author was just happy that he managed to get on LED, and red charging LED. It is soldered onto
components that looked as if they should work. the pins from the Pico which fit through the PCB,
enabling a slimline construction. The base of the
GETTING THE BOARD MADE WAS THE Pico exposes the micro USB socket, which is used
EASIEST PART
The author was expecting all kinds of problems
getting the circuit board made, but this was the
easiest part of the process. You can add ‘plugin’
elements to KiCad, and one of the things you can
add is a plugin from the PCB manufacturer. In the
author’s case, this was PCBWay (pcbway.com),
which had generously offered to sponsor the project.
The plugin prepared the project for submission, sent
QUICK TIP it to the manufacturer, and then opened a web page
for the order. The page also showed a visualisation
Rather than add
of the board for checking. The process was all very
wires to your circuit
diagrams, you smooth and well-managed – six days after the order
can label inputs was submitted, the finished boards arrived.
and outputs and Figure 5 shows a completed keyboard. The
KiCad will connect switches have been placed for left-handed use. The
them. If the author thumb is used to select between text entry and
had done this, he
control functions. The author had hopes of being
wouldn’t have got
the connections the able to use a chord keyboard with his left hand and
the mouse with his right. He was hoping that his Figure 5
wrong way round on The tracks on the top of the board connect the Pico to the
one of the displays. brain would transpose chord designs learnt for the display. Tracks on the bottom connect the key switches

72
FORGE

for charging. The SHIM exposes the indicator LEDs


and power button. The author has found this to be a
neat way to create battery-powered Pico projects.

PANEL BEATING
Figure 7 shows the front panel of the keyboard. It is
a solid piece of printing which has deeply recessed
holes for each of the keys. The positions of the
keyholes must exactly line up with the sockets in
the PCB. Figure 6
If you want to be
Figure 8, overleaf, shows the case being designed able to change the
in FreeCAD. On the right-hand side, you can see key configuration,
you can add extra
the Python code that is used to create objects that switch sockets for
describe the positions of the keys on the PCB. the additional key
positions that you
want to use
Index_1=["Index_1",168.60,52.66,17.38,17.38]
import pcbnew
The statement above shows the object that defines
the position of the hole for the first index finger key. file = "C:\\Users\\rsmil\\Blue Chord\\pcbKeyboard.
The first item in the object is the name of the key, KiCad_pcb"
this is followed by the X and Y coordinates and the
width and height of the hole. The variable keyHoles board = pcbnew.LoadBoard(file)
at the bottom of the code contains a list of the key
objects to be used for this keyboard. It also sets the l = []
position of the hole for the display.
for f in board.GetFootprints():
keyHoles = [Little_5, Ring_5, Middle_2, Index_1, b = f.GetBoundingBox()
Thumb_1, Control_2] ref = f.GetReference()
p = f.GetPosition()
If you want a different set of key holes, you just px = (p[0] / 1000000.0)
change the contents of this list. The hole information py = (p[1] / 1000000.0)
is extracted from the PCB design by another piece height = b.GetHeight() / 1000000.0
of Python that runs inside FreeCAD and generates width = b.GetWidth() / 1000000.0
these object positions: t = '{0} = ["{0}",{1:.2f},{2:.2f},{3:.2f},{3:
.2f}]'.format(ref,px,py,height,width)
l.append(t)

l.sort()
for t in l:
print(t)

The Python code above runs inside the KiCad QUICK TIP
PCB Editor and uses the pcbnew library to read
Don’t be afraid to
the footprint positions from the PCB design. It
add a bit of weight
works through the footprints, extracting the name to your prints. The
and position of each and assembling an object keyboard is all the
description. Each of the definitions is added to better for being
a list which is then sorted and printed. The heavier; it is less
program uses the Python format feature to print inclined to move
about when used.
out all the values in millimetres with only two
The author considers
decimal places. This provides the list of component that the extra heft
Figure 7 positions you can see in FreeCAD in Figure 8 and
The keys snap into the holes in the front panel. They are not was worth the six-
supported by the PCB underneath. They just plug into it Figure 9, overleaf. hour printing time.

73
Pico W-powered Bluetooth chord keyboard

TUTORIAL

Figure 9 shows the Python window in KiCad sides of some of the keycaps needed to be filed
Figure 8 with the output from the program. The amount of down a tiny amount so that they moved smoothly.
The kicadStepUp
plugin for FreeCAD footprint data being transferred was very small. If The design needs an increase in the spacing of all
has been used to you had a large amount of position information to the keys by about half a millimetre. At this point, the
import the PCB
design so that it can transfer into FreeCAD, you could write the code author has decided that it would be a good idea to
be checked against
the case design
into a file to be included in the FreeCAD script. This use a Python program running in KiCad to position
would allow you to closely integrate the PCB and the key footprints as well as generate the position
Figure 9
The shell window case creation. information for FreeCAD. So, the next version of the
contains the keyboard will be created using this approach.
output from all the
print statements ONE FUNCTION TO RULE THEM ALL
in the program The keyboard, as designed, works well, but it turns C++-POWERED KEYBOARD
out that the keys are a bit too close together. The The code that controls the keyboard is based on
the Pico W Bluetooth example ‘hid_keyboard_demo’
application from the Pico examples at
github.com/raspberrypi/pico-examples. This
program has a demonstration mode which sends a
preset string of text out of the keyboard. It uses a
timer to trigger the transmission of each character.
The timer has been repurposed to call the scan_keys
function, as shown below:

#define SCAN_INTERVAL_MS 20

static void key_scan_timer_handler(btstack_timer_


source_t *ts)
{
UNUSED(ts);
// scan the keyboard
char ch = scan_keys();
// do we have a key press?

74
FORGE

if (ch != 0)
{
// send the key
stdin_process(ch);
}
// set timer for next character
btstack_run_loop_set_timer_handler(&demo_
text_timer, key_scan_timer_handler);
Figure 10
btstack_run_loop_set_timer(&demo_text_timer, The keyboard
generates a different
SCAN_INTERVAL_MS);
Bluetooth address
btstack_run_loop_add_timer(&demo_text_timer); each time it starts
}
out to be quite successful. ChatGPT can take
The key_scan_timer_handler function is called every Python arrays and dictionaries and convert them into
20 milliseconds (50 times a second). It calls the equivalent C++ code. However, the code it produces
scan_keys function and then restarts the timer. The is quite long-winded, so in the end, the author
scan_keys function performs ‘debounce’ on the input converted the tables by hand using a few edits.
signals. Mechanical switches can produce a rapid
sequence of high and low outputs as their contacts THE RE-PAIR SHOP
open and close. The debounce code ignores these Before the keyboard can be used with a device,
short pulses. A non-zero result from scan_keys it must first be paired with it (Figure 10). Follow
indicates that a character has been entered. The the Bluetooth pairing process for the device you


stdin_process function want to use it with.
is called to transmit the The screenshot above
character. The stdin_ It is useful to be able to is from Windows 10.
process function is part Once the keyboard
configure the key positions;
of the original demo has been paired, it will
it is surprising how different


code, where it is used remake a connection if
to transmit characters the device disconnects.
one hand can be from another
arriving on the standard However, if you turn
input stream. This the keyboard off and
function also manages Bluetooth pairing, connection, on again, you may have to re-pair it. This is because
and disconnection. If you want to develop the code the demonstration code the keyboard uses doesn’t
further, you can find it all in the project repository. retain pairing information inside the Pico. The good
The keyboard also uses a library for the SSD1306 news is that battery life is good, so you don’t have to
display, which you can find on GitHub here: turn the keyboard off very often.
github.com/daschr/pico-ssd1306.
KEY POINTS
USING CHATGPT TO CONVERT FROM The keyboard was fun to make and works well. It
PYTHON TO C++ is useful to be able to configure the key positions;
This project is based on a previous one written in it is surprising how different one hand can be from
the Python language. A central component of the another. The author even found differences in his
Python solution is a set of lookup tables that decode left and right hands, requiring different keyboard
the chord bit patterns from the input switches into arrangements for each. The integration of Python into
character codes. These needed to be converted from the build process means that you can create printable
Python to C++. The author thought he might use designs for cases which exactly match the PCBs.
the ChatGPT chatbot (chat.openai.com) to do this. All the software for the keyboard is in the repository
ChatGPT is a language processing tool that has been for this project on GitHub, so you can make your own
trained on many millions of articles, including lots version. There are also code images for left-handed
about programming. It is adept at taking language and right-handed versions of the keyboard code that
input and transforming it. So, a session was opened, you can just copy into your Pico W if you don’t want
and the Python code was pasted in. ChatGPT was to build your own software. The author is looking
then asked to produce a C++ version. This turned forward to making more PCBs.

75
Planetary gears

TUTORIAL

Planetary gears
Get a wide range of gear ratios in a small space

W
e’ve looked previously at gear system to be useful, one of these has to be
how to 3D-print gears, where held still, one has to be driven, and the final one is
one gear drives another and the output.
the ratios of the two gears The ratios and the orientation of the output will
determine the relative speed depend on not only the sizes of the gears, but also
of the two gears. This can the way in which the gears are driven (or held).
Ben Everard work well, but does have a few problems. Firstly, What does all this mean in practice? Let’s
it can take up a lot of space and, secondly, it’s take a look with a simple model downloadable
@ben_everard
not the most durable system. One alternative is a from: printables.com/model/495872.
planetary gear-box. In this system, there are three There are three planetary gears, one sun gear,
Ben’s house is slowly
being taken over by 3D
sets of gears: an inner (or ‘sun’) gear, three or more and one ring gear. These all have herringbone teeth
printers. He plans to ‘planetary’ gears that rotate around it, and a ring gear which help them stay in place without any internal
solve this by printing an around the outside (see Figure 1). supports, but these do mean that it’s a bit of a
extension, once he gets
enough printers. There are three potential inputs into this system – squeeze to put everything together. The planetary
through the sun gear, through an attachment to the gears do have to be positioned quite precisely
planetary gears as they rotate around the sun, and for the whole thing to work, but we’ve found the
through the rotation to the ring gear. In order for the easiest option is to jam them in at roughly the right
place, and then adjust them later.
Once you’ve got all the bits in place, the first thing
to do is play with it. It’s ridiculously addictive to just
spin this in your fingers in different ways, and it’s

” It’s ridiculously
addictive to just spin this in
your fingers in


different ways

probably worth printing just for this alone. However,


it’s a bit hard to really get a feel for how it works by
just playing with it. This is because there are three
points of control and humans only have, at most,
two hands. In order for us to gain a bit more out of
it, we’re going to need some extra bits.
The first of these is the planet assembly. This is
an attachment, with axles for each of the planetary
gears, that allows you to extract the rotation from
them. To put it in, simply put each of the axles into
the centre of a planetary gear. They should fit in

76
FORGE

perfectly – if they don’t, then the gear isn’t in


quite the right position. To get it into position, bend
3D-PRINTABLE Figure 1
There’s something
the ring gear slightly so it disengages, then rotate PLANETARY THINGS beautiful about
the planetary
the planet a little, and re-engage the ring gear. arrangement
If you're looking to explore planetary gears further,
Repeat this until all three planets fit perfectly into there are some more fun things you can print.
the assembly.
Now, if you hold the ring gear still, and rotate the There's a little toy at hsmag.cc/PlanetaryGear
sun gear, the planetary assembly should spin. The
crucial part of a gear chain, though, isn’t that it spins, Or you can add power to your build with this stepper
motor gear box hsmag.cc/Nema17
it’s that it spins the correct amount.
Calculating the gear ratios of a planetary gear This example uses planets of different sizes to create
system is a little more complex than with regular a motion where the sun gear moves around while it
gears (but only slightly), so you might have to break spins. This spirograph-like motion can be used to stir
out the calculator. ground coffee in an espresso portafilter. Does it
We’ll be looking at the transmission ratio, which make better coffee? No idea, but it looks cool –
hsmag.cc/Umikot
is the number of times the drive gear turns for each
turn of the output gear. A transmission ratio of less In this print, the planet carrier is the hour hand, the
than 1 is a reduction, meaning that the output spins sun is the minute hand, and the ring is fixed –
less than the drive (but will have more torque), hsmag.cc/SelfadjustingClock
whereas a transmission ratio of more than 1 means

77
Planetary gears

TUTORIAL

that the output spins more than the drive (but with
Above THREE-SPEED HUBS less torque). In this case (with the ring gear held
The gears have to
be the correct way still), you can use the following formula:
around to mesh For simple systems, it might be enough to use planetary
gears in fixed ratios. However, in more complex
systems, you might want to change the ratio. The Transmission ratio = 1 + (number of teeth on the ring
most famous variable-speed planetary gearbox is the gear / number of teeth on the sun gear)
‘Sturmey-Archer’ system that provides three speeds
and can be embedded directly in the hub of a bike wheel
In our case, there are 51 teeth on the ring gear
(not to be confused with the more common external
style of derailleur gears). and 27 teeth on the sun gear. This means that the
In this system, the power is driven through either the transmission ratio (or the number of times the sun
planetary gears or the ring gears, and the power output gear rotates for every rotation of the carrier gear) is
is also from these two. Depending on which way around 2.9. What’s more, we’ve achieved this reduction in a
the drive is (either driven through the ring and output small space with the same axis of rotation.
from the planets, or driven from the planets and output
That isn’t the only way you can transmit power
from the ring), you get high or low gearing from the hub.
through these gears, though. If you print the buggy
The middle gear is direct-drive.
These were first devised in 1902, and are still in body, you can place this on the assembly to keep the
use today because they can be significantly lower planetary gears in the same place. This is designed
maintenance than external bike gears. to be part of a wheeled buggy, where the ring is the
wheel itself and it’s driven through the sun gear. In

78
FORGE

(Number of teeth on the sun gear + number of teeth


Left
on the ring gear) / number of planetary gears = a The planet gear sits
whole number. between the sun and
the ring and is held in
place by them
In this case, we’re using a sun gear with 27 teeth,
a ring gear with 51 teeth and three planetary gears,
so this condition is satisfied. You can calculate the
number of teeth on a gear using:

Number of teeth on the ring gear = 2 × (number of


teeth on the planetary gear + number of teeth on the
this case, the planets are held stationary. sun gear).

Transmission ratio = -( number of teeth on the ring You can rearrange this to calculate the number of
gear / number of teeth on the sun gear). teeth on the third type of gear once you’ve fixed the
number of teeth on the other two. In our case, we
Here, the ratio is -1.9. It’s negative because the know our ring gear has 51 teeth and the planetary
direction of rotation is reversed. This method of gear has 27 teeth, so, we can rearrange this to:
driving wheels gives us much more torque than we
would otherwise have. Though, if you do want to do Number of teeth on the planetary gear = (number of
this on a real buggy, you’ll need to make the wheels teeth on the ring gear – number of teeth on the sun
far stronger than our test gears because they easily gear) / 2
deform and stick.
This gives us twelve teeth on the planetary gear.


Planetary gears can be a great way of getting the
The ratios here are ratios we need in a small size. The total size of the
obviously very dependent gear system can be the size of just a single traditional
gear. 3D-printable herringbone patterns also help
on the numbers of teeth on keep everything in its proper place. However, they do


the gears require you to think a little more about how to achieve Below
You can build planetary
the ratios you want, and assembly can be a bit more
gears directly into
complex than with simple gears. wheel hubs
There is, as you might expect, a third way
of driving this gear. You can hold the sun gear
stationary, and drive either the ring gear or the
planetary carrier. This is harder to do with our setup,
but not impossible. The transmission ratio between
the ring and the planetary carrier, in this case, is
calculated using the equation:

Transmission ratio = 1+(number of teeth on the sun


gear / number of teeth on the ring gear)

In our case, this is 1.53. This gives us three different


ratios we can achieve. There is actually a fourth option
– if you fix the planetary carrier to the ring gear, then
you get a direct-drive system with a ratio of 1.
The ratios here are obviously very dependent on
the number of teeth on the gears. However, you
can’t just mash together any three different-sized
gears and hope that you’ll have a planetary gear
system. Everything needs to fit together, and that
means that it has to satisfy the equation:

79
Macramé: A beginner’s guide

TUTORIAL

Macramé:
A beginner’s guide
Get creatively knotted with a very traditional craft that’s well and truly back in vogue

M
acramé was a very popular
pastime back in the 1970s, which
was perhaps a golden age of
handicrafts of all kinds, when this
form of creative knotting was
used to fabricate lampshades,
Nicola King plant hangers, wall hangings, and many a
bohemian beaded waistcoat with intricate and
@holtonhandmade delicate patterning. This author fondly remembers
her mum’s extensive collection of ‘Golden Hands’
Nicola King is a freelance periodicals, an informative series of magazines
writer and sub-editor.
Her favourite craft that sought to share crafting goodness with the
changes week by multitude. Macramé, in some form, always seemed
week, with her sewing to be in every single issue.
machine currently in
quilting overdrive. However, like many fibre-related crafts, macramé’s
history predates that particular era by some time,
in fact by thousands of years. For example, some Above
There are many books available on the subject, and a pattern
decorative carvings of the Babylonians and Assyrians book of some kind is always useful as an inspiration source

80
FORGE

YOU’LL NEED
3 mm macramé
cord (e.g.
hsmag.cc/
MacrameKit)

Sharp scissors

A tape measure

A keyring (with
a D ring-shaped
base – hsmag.cc/
DRingKRing)

A comb for
fringing (optional)

Left
A few of the additional
bits and bobs you can
use within your work.
The wooden beads and
rings and dowels really
complement the natural
fibres being used


Macramé is another calming and mindful hobby,
The beauty of the craft and you can use it to create a huge variety of useful
is that there are no household items, as well as beautiful pieces of art
and jewellery.
hooks or


The beauty of the craft is that there are no hooks
needles required or needles required, as we are not weaving or
knitting here – we are just knotting with our hands.
Also, the emphasis is very much on using natural
feature macramé-style knots. More recently than fibres such as cotton, jute, or hemp, for example –
that, 19th century British and American sailors also ideally these fibres are sustainable and plastic-free,
made hammocks and belts from macramé, although so it can be argued that macramé is quite a ‘clean’
back then it was called ‘square knotting’.
Well, you can’t keep a good craft down and,
after falling out of fashion in the 1980s following
its previous resurgence, macramé is popular once
again, with millennials picking up on its relaxing
benefits. You can find macramé kits in abundance
in craft stores, and this author has even seen plant
hanger kits for sale in supermarkets, and she’s
happy at the craft’s revival. When she moved Left
A selection of
into her present family home many years ago, a macramé cords –
macramé lampshade adorned the ceiling of one obviously, as with
any fibre craft, the
of the bathrooms – it went swiftly in the bin but thicker the yarn, cord,
now, as a fibre and textile crafts fan, she slightly or rope that you use,
the larger the finished
regrets casting aside someone’s vintage hard work. product will be

81
Macramé: A beginner’s guide

TUTORIAL

QUICK TIP
Work at a clear,
roomy table with
good lighting so that
you can clearly see
what you are doing.

Figure 1
Attaching cord with
the useful lark’s
head knot. This knot
is also often used
in jewellery making,
and is also called a
cow-hitch knot

hobby to pursue. Plus, if you decide to give it a try,


WHAT CAN I MACRAMÉ WITH? you need very little in terms of equipment, so your
There are several options in terms of the fibres that can be used for this craft. Below are craft space won’t get unnecessarily cluttered and,
the main natural ones to consider, although you can also macramé with synthetic fibres perhaps most importantly, macramé is not hard to
should you so wish. We’ve opted to concentrate on natural fibres as they look great, learn – once you have mastered just a handful of
are perfect for indoor projects, and they are biodegradable. Be aware that, if you are knots, you can make a plethora of items. So, in this
making projects that will sit outdoors with natural fibres, that biodegradability feature
tutorial, we are going to give you a basic macramé
will mean that your makes will eventually degrade over time. For example, cotton will
yellow in the sun, and jute and hemp will be affected by rain and sun – just something to
taster session.
bear in mind.
Clearly, the thickness of your material is a key choice, depending on what you LET’S GET TIED UP IN KNOTS
are making. You’ll need to consider the ply, i.e. how many strands have been twisted We’re going to make a very simple keyring, and will
together to make a piece of cord or rope, and what effect does that give? Thicker fibres be looking at just three basic knots: the lark’s head
can be more challenging to work with, but certainly make a statement piece. knot, which simply attaches our cord to the keyring;
the square-knot, which will create the main body of
• Cotton – the world’s most used natural fibre, it is soft and fairly strong too, and
popular in the macramé world. It also gives a smooth finish and is the most versatile the piece; and the gathering knot, which will finish
macramé fibre. Flexible and widely available, cotton is easy on the hands and won’t off our work.
stretch over time. It also comes in various thicknesses, from string to cord to rope,
from ²/3 mm up to 40 mm. STEP 1 CUTTING AND ATTACHING
• Jute and hemp – these are both fibres with low elasticity and a similar tensile OUR CORD
strength. Jute is extracted from the stem of the jute plant, while hemp comes from
A top tip is never to underestimate how much cord
the stalk of the hemp plant. Both of these can be more difficult to work than cotton
and can be very rough on the hands, but they arguably have a very rustic and you are going to need. In fact, estimating how long
natural look to them, so it really depends on the aesthetic you are aiming for. to cut your cord length is arguably one of the most
• Linen (in cord or yarn form) – perhaps not as common as other macramé materials, difficult stages. There’s a tendency to cut cords too
this fibre comes from the flax plant. More difficult to come across, but very strong, short, and you don’t want to be joining cords halfway
and often used for jewellery making. through your make. We’ll cut two lengths of two
• Silk and leather cord – both extremely strong macramé fibres, but perhaps less
metres each of our cord.
common. Leather cord is often used in jewellery making.
We then use the simple lark’s head knot to attach
• Natural yarns – including merino wool, alpaca wool etc. Macramé knots will be
much smaller if you use a natural yarn, however, as the fibre compresses so much. the cord to the keyring. Take one length of cord
– we’ve used 3 mm cord – and fold it in half. Take

82
FORGE

RESOURCES
If you’re interested in giving this craft a go, it’s useful
to do a little research before you start, and there are
many books/websites that can answer any questions
you may have and give you a dash of inspiration. Many
modern macramé patterns have a contemporary twist
so, don’t worry, no 1970s throwbacks, unless of course
that’s the look you are aiming for:

• Macramé Pattern Book – Marchen Art – a handy


guide that contains over 70 patterns that you can
turn to for a multitude of projects
• Modern Macramé – Emily Katz – contains a whole
Figure 2 heap of projects to get stuck into
A square-knot up close. We had to practise this a few times, but • Macramé: Techniques and projects for the
once we’d learnt it, we were away! complete beginner – Sian Hamilton and Tansy
Wilson – a great place to start for a newbie
the looped end and thread it through the back of • YouTube – Majestic Macramé (youtube.com/
the D ring part of the keyring. Then, pull the cord @majestic.macrame) – lots of very clear videos to QUICK TIP
ends through the middle of that loop in the cord help you on your macramé way When using natural
• YouTube – Macramé School (youtube.com/ fibres, ensure you
(Figure 1). Repeat with the other length of cord.
@macrameschool/videos) – make a macramé store them well
You should now have four lengths dangling from flower, make a macramé fish… it’s up to you before you use them,
your keyring. We will be working with the two outer • Website: macrameuk.com – includes a ‘Knot bible’ wrapping them in
cords throughout. The two central cords are called page for easy reference something so they
the knot-bearing cords, and you should try and keep don’t get too dry.
these two cords as straight and taut as possible.
cord (through the loop). Pull to secure your square-


knot (Figure 2). Repeat this until you have achieved
There’s a tendency to cut the length you require.
cords too short, and you
STEP 3 FINISHING OFF
don’t want to be joining cords When you are happy with the length of your work,


halfway through your make it’s time to tidy up your ends. First, cut another Figure 3
A gathering knot to
length of cord, around 20 to 30 cm in length. Place
pull the ends of
the end of that against the loose cords, leaving a your work together
STEP 2 THE SQUARE-KNOT short end on the top, and form a loop, then wrap
Before we begin the main body, a word on tension. this new cord tightly around the bottom of your work
Everyone’s tension is different, and we are aiming several times. Then take the end of that cord and
for a uniform, natural tension throughout. Don’t pull pull it through the loop you made (Figure 3 uses a
the cords too tightly, but don’t leave them too loose contrast colour to illustrate). Now, pull on the short
or you’ll have huge gaps in your work – just pull end of the cord until the lower end of the cord is
them using a tension that feels natural for you and pulled up into the wrapped knot. Trim either end of
gives you the effect you want. that cord and tuck any loose ends into the wrapped
Take the left-hand knotting cord and take it over knot. You can then either trim the remaining loose
the two knot-bearing cords, and under the right dangling ends to a length you like, or you can use a
knotting cord. Bring the right knotting cord to the comb to turn them into a fringe, as we have done.
left, under the two knot-bearing cords and over the Once you’ve learnt a few knots, you can obviously
left knotting cord (through the loop you've created). gravitate towards more complicated macramé
Pull the knotting cords, ensuring the knot-bearing patterns, and maybe experiment with adding glass
cords are straight and taut. Now for the other side beads, shells etc. to create more elaborate and
– bring the right knotting cord to the left, over the ornate pieces. We’ve also seen amazing work
knot-bearing cords and under the left knotting cord. where artists have used a cotton hand dye and
Finally, bring the left knotting cord to the right under paintbrushes to colour their unique creations with a
the knot-bearing cords, and over the right knotting stunning ombré effect. So, get knotting!

83
DON’T MISS THE BRAND NEW ISSUE!

SUBSCRIBE
FOR JUST

£10!
> T
 HREE!issues
of The MagPi

> F
 REE!
Raspberry Pi
Pico W

> F
 REE!
delivery
to your door

NEW
+ FREE
MO
DEL!

RASPBERRY PI
*W

PICO W*
hil
es
toc
ks
las
t

Three issues and free Pico W for £10 is a UK-only offer. Free Pico W is included with a
12-month subscription in USA, Europe and Rest of World. Not included with renewals.
Offer subject to change or withdrawal at any time.

magpi.cc/subscribe
FIELD TEST
HACK MAKE BUILD CREATE
Hacker gear poked, prodded, taken apart, and investigated

PG

92
HEXTRACTION
PG
86
BEST OF
3D-print yourself a new game

BREED The best new maker


products available now

PG

96

WYLDCARD
An e-paper card game platform for developers
New and newish products that you can buy right now!

BEST OF BREED

ONLYTHE
BEST
New and newish
products that you
can buy right now!
A collection of electronics for your next project

By Marc de Vinck @devinck

I
’ve been writing these Best of Breed
reviews for a while; at last count, it was
over 60 issues covering over 350
products! With so many reviews, it can
sometimes be challenging to come up with
a new theme. At first it was easy to pick
products, from displays and microcontroller boards
to barometers and the hundreds of different sensors
available for a Raspberry Pi. But when the supply
chain issue hit the global economy, and so many
developers went into hibernation, new products
became much more difficult to find. Good news!
Things have finally changed!
Only until recently have manufacturers, both large
and small, been able to source components like the
amazingly versatile RP2040 to create new boards store or website, but it’s getting better. Everything is
and not worry too much about the supply. And getting better. Finally!
common components required for products, like So, in this Best of Breed, I’ll be looking at some
resistors and potentiometers, are now more readily new and newish items hitting the market. There are
available too. It’s still not an ideal world when it a lot of great products out there, and they are in
comes to sourcing parts, and sadly it’s going to be a stock, ready to be soldered, tinkered, and integrated
while longer until you can just grab any into your new project. Let’s look at some of my
microcontroller or single-board computer from a local favourite new – at least new to me – products.

86
FIELD TEST

RGB Encoder Wheel


Breakout vs Nicla Voice
PIMORONI $20.31 pimoroni.com ARDUINO $82 store-usa.arduino.cc

E
ncoder wheels are cool, but RGB
encoder wheels are really cool!
Pimoroni has done a great job
integrating a Nuvoton MS51
microcontroller and rotary scroll
wheel to allow a lot of functionality to
your project. This encoder features 24 RGB LEDs,
directional four-way navigation, centre click and scroll
wheel, all with nice clickety clicks. The encoder is
easy to integrate into your next Raspberry Pi project
thanks to the convenient I2C breakout.
The board is fully assembled and works with either
3 V or 5 V boards. It also includes a nice Python library Left
Spinning wheels
and schematic, allowing for quick integration. and flashing lights!

T
he small form factor Nicla Voice for
Arduino allows anyone to easily
implement always-on speech VERDICT
recognition into their next build, even
RGB Encoder
a wearable. It features Syntiant’s Wheel Breakout
NDP120 Neural Decision processor
RGB Encoder!
running multiple AI algorithms and advanced
What’s not
machine learning. It’s an amazing little device! to love?

10/ 10
And even more amazing is that most people,
even beginners just starting out with an Arduino,
could easily add voice recognition to their build. OK,
maybe advanced beginners.
The Nicla Voice obviously includes a microphone, Nicla Voice
but it also has an integrated six-axis motion sensor Amazing, but at
and magnetometer, and on-board Bluetooth Low a price.

9/ 10
Energy (BLE) connectivity. It’s a powerful little board
Above that also runs in an ultra-low power mode, making
Speech recognition, even
when you’re short on space 24/7 always-on sensor data processing possible.

87
New and newish products that you can buy right now!

BEST OF BREED

Inventor HAT Mini


PIMORONI $25 pimoroni.com

I
really love all of Pimoroni’s products. Each
one is well thought out, always has great
documentation, and includes easily
understandable code. The new Inventor HAT VERDICT
Mini is no exception. It’s a versatile board that Inventor HAT
allows for simple motor, servo, and audio Mini
control for your Raspberry Pi. It’s expandable, too, A handy little
with its well-thought-out pass-through headers board, making
allowing you to stack on additional boards. It also connecting
includes four extra ADC-capable GPIO pins for adding servos easy!

9/ 10
more sensors. And if that’s not enough, it also
features eight addressable RGB LEDs for some
variable feedback opportunities.

88
FIELD TEST

SparkFun DataLogger IoT – 9DoF


SPARKFUN $74.95 sparkfun.com

S
parkFun has another handy
multipurpose breakout board: the
DataLogger IoT – 9DoF. It’s a utilitarian
board with a utilitarian name. The board
comes pre-programmed and will start to
automatically output all the IMU, GPS,
pressure, humidity, and distance sensors once
powered up. You won’t need to write any code, which
can be good or bad depending on your background. VERDICT
I think there are lots of people out there who just SparkFun
need the data and don’t want to fiddle around in an DataLogger IoT –
IDE. If that’s you, this is a great board. It was 9DoF
designed for users who just need to capture a lot of Useful and pre-
data to a CSV or JSON file and get back to their programmed.

8/ 10
project. You can save the data to a microSD card or
wirelessly to an IoT web service. A great solution for
many people.

LOAD CELL

SPARKFUN $12.95 sparkfun.com


Load cells are common when it comes to DIY electronic
projects. Being able to precisely measure the weight of
objects is easy, and the resulting data is much more precise
compared to using an inexpensive piezo. Load sensors like
this one – also called a strain gauge – can measure much
heavier loads. I’ve come across many different types, but
this one is unique, since it includes a means to hang the
sensor and the object to be weighed. It’s not overly
complicated to build yourself, but it is nice to have it ready
to go with the hooks and required extra hardware.

89
New and newish products that you can buy right now!

BEST OF BREED

Adafruit PiCowbell
DVI Output for Pico
ADAFRUIT $6.96 adafruit.com

A
dafruit has another uniquely
named, and uniquely functioning,
breakout board for the Raspberry
Pi Pico – it’s the PiCowbell. This
little board allows you to display
images and graphics from a VERDICT
Raspberry Pi Pico directly to an HDMI monitor or Adafruit
television. The board also features a Qwiic/STEMMA PiCowbell DVI
QT connector for fast I2C, a reset button and switch Output for Pico
for rebooting or changing configurations. And did you If you need video
see the price? Yeah, it’s inexpensive, to say the least! from a Pico, you
I have a lot of projects that could use this handy little need this!

10/ 10
breakout board to make my life so much easier. If you
need video, check out this board. Just note, it’s video
only, no audio. But it’s still awesome!

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

Plus much, much more!

£10 with FREE


worldwide delivery

Buy online: magpi.cc/BGbook


Hextraction

REVIEW

Hextraction
Print your own puzzle game

playhextraction.com FREE voidstar

By Ben Everard @ben_everard

L
ots of makers create bits and pieces The game board is a slanted grid of hexagonal
for games. We’ve seen miniatures holes with on-ramps at the start and off-ramps at the
3D-printed, tables laser-cut, and dice end. Each player takes turns to put a tile in the board
created using almost every method and roll a ball down an on-ramp (not necessarily
conceivable. Hextraction is a little in that order). If the ball gets stuck or falls off the
different because you can make the board, then nothing happens (any stuck balls are left
entire game. on the board whether they’re stuck intentionally by
You can 3D-print almost everything – the only a tile or by accident of a tile misfunction). When the
things you have to buy are spools of filament and board is full, then you can start destroying tiles, and
a handful of 10 mm ball bearings. Some tiles might if you run out of tiles so you can’t play any more, the
also require a bit of hardware, such as a bolt or game’s a draw.
magnet. It takes quite a bit of printing to get started So far, so straightforward. A lot of the tiles are
Below
Tiles can include (expect to keep your fabricator humming for a couple simple directional tiles that take input from one
multiple parts,
like this two-piece
of days). It’s a great way of using up odds and ends direction and send it out another way. Some tiles
teleporter tile of filament because it looks great in a riot of colour. use basic physics to introduce effects, such as the
‘flip-flop’ tile, which sends the ball out an alternate
way each time, or the Pancho tile, which has a
simple randomiser. Things get most interesting,
though, with the special effects tiles – these have
accompanying rules. For example, the teleporter set
has ‘in’ and ‘out’ tiles, and when a ball goes into the
in tile, you then start the ball again in the out tile.

SOLOTAIRE
There are also a couple of ways of playing the
game by yourself – one where you take on a hoard
of invisible monkeys (yes, really), and one where
you create a random puzzle that you have to solve.
Both of these use the same tiles and board as the
multiplayer version, so you can print up a single set
before deciding what to do.
Perhaps the most interesting part of this game
– at least from a maker perspective – is that it’s
designed to be open source.
There’s no fixed set of tiles that you have to use
(though there is a recommended set for starting
with), and you can simply print whichever ones you
want to use. You can even take it further and design

92
FIELD TEST

Above
Simple physics effects – like this sozu tile, which only turns
when the second ball hits it – can create fun gameplay

your own tiles for your games. There’s a blank tile


design available and you can modify this to create
whatever tile you like, and share them with other
players. Designing a tile isn’t a completely trivial
CAD task, but it’s a decent starting point if you want
Left
to learn more and enhance your skills. It’s something There are already
we’ll be investigating in the next few weeks, and if lots of different
tile designs to get
there’s interest, we’ll do a tutorial on creating your you started
own tile.
At the time of writing, the game is only a few website (thangs.com), and that’s where you’ll
weeks old, but there are already several third-party find the majority of the tiles. Obviously this does
tile designs available. The Hextraction community give players enough scope to create tiles that are
is centred around the Thangs 3D design sharing terrible as well as great. The solution for this is that
the game is democratic. At any point in the game,
players can vote to get rid of a tile if they think it’s
having a negative effect on the game.
There are enough designs now to make a fun
game, but it’ll be interesting to see where the
community takes this game. What new tiles can
create new styles of gameplay? Time will tell.
We’ve had a bit of trouble with a couple of tiles
not performing quite as expected, particularly the
‘Da Bomb’ and ‘Triple Trap’. It’s hard to say if there’s
a fundamental issue with these tiles or if they just
don’t like the particular print settings we’ve used.
We’ll experiment a little, but no tile is essential to
play, so if you do have a tile that’s not performing as
you’d like, you can just not include it in your game
and print out some others. Other than this, it’s been
easy to play and print.
We’ve had great fun building and playing
Hextraction. The game is a bit like a puzzle solver, VERDICT
and a bit like a collectable card game (only with tiles A fun 3D
instead of cards). Exactly how the gameplay goes printing project
depends a lot on what tiles you have. Some people with scope to
will prefer the simplicity of more physics-based help you learn
games, while others will want to explore the full 3D design.

9/ 10
range of complexity that special effects can bring.
Above It’s entirely up to you (and the people you play with)
The entire game can be 3D-printed,
including the board and stand what tiles you include.

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

Get game design tips and


tricks from the masters

Explore the code listing


and find out how they work

Download and play game


examples by Eben Upton

Learn how to code your own


games with Pygame Zero

Available now hsmag.cc/store


Crowdfunding now

REGULAR

CROWDFUNDING
NOW

Wyldcard DevKit
The card game that changes as you play it

From $270 hsmag.cc/wyldcard Delivery: Nov 2023

W
yldcard is a system for building developer time and polish, so it doesn’t seem
card games, except, unlike regular unreasonable. However, a DevKit (which is needed to
card games, the cards can change use the cards) is $270 – we can knock off $60 for the
as you play them. E-paper allows a price of the included cards, so that’s $210 for a
console (known as a Plinth) to send Raspberry Pi Zero, an enclosure, and a PCB to mount
new images to the cards so that they can adapt to the cards on. That feels a bit pricey. Perhaps that
the gameplay. This could be aesthetic (such as could be justified if you could then play a game, but
showing your characters sustaining damage), or alter you need two of these for a two-player game, so
the way the card is used in the game. As the name you’re over $500 (including the cards) in total before
suggests, this is a DevKit for people looking to make you even start playing. Again, this could perhaps be
games (the team have created a JavaScript API to justified if it was paying for developer time to make
help you work with the hardware). At present, there the game, but this doesn’t include any games – it’s
are no games available, so it is down to you to build the developer kit for you to create your own games.
something interesting. Despite all this, the hardware does look like it’s
While this does look cool, we find the cost well-thought-out, and there are probably some
proposition a bit strange. A set of three e-paper cards interesting game dynamics possible with this style of
for $60 is on the steep side, but you’re paying for setup. Is it worth the money? That’s up to you.

96
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.

97
#69 ON SALE
27 JULY

SUMMER
PROJECTS

ALSO
RASPBERRY PI
3D PRINTING
LASER CUTTING
MUSIC
AND MUCH MORE

DON’T MISS OUT

hsmag.cc/subscribe
Cha-ching
Franz’s coin sorting machine, which he’s kindly shared with
the world on Printables.com, is a great example of the way
that different materials can mess with our sense of scale.
Wood, with its user-friendly grain feature, gives you an at-a-
glance idea of how big something is. The tiny imperfections in
concrete, the crystals in a block of stone, the fibres in wool, all
serve to lend a familiarity to objects that we’ve not seen before.
This is different. We can honestly say that the first time
we looked at this machine, we thought it was the size of a
rollercoaster ride. 3D printing has been around for a while now,
but it still counts as new in the human tradition of building things.
The rule book hasn’t been written yet, so go forth: play, fail,
and learn.
PiKVM Manage your servers or
workstations remotely

A cost-effective solution for data-centers,


IT departments or remote machines!

PiKVM HAT
for DIY and custom projects Pre-Assembled version

Real-time clock with rechargeable super capacitor OLED Display Bootable virtual CD-ROM
& flash drive Serial console Open-source API & integration Open-source software

Available at the main Raspberry Pi resellers

Reseller suggestions and inquiries:


wholesale@hipi.io

You might also like