HackSpace Magazine - Issue 57
HackSpace Magazine - Issue 57
HackSpace Magazine - Issue 57
Robot Beer
Roundup RASPBERRY PI BBQ
Make your Turn a keg into
PICO W
Raspberry Pi move an outdoor grill
PROJECTS
Aug. 2022
BEAM
Issue #57 £6
Make internet-connected
builds with the NEW $6
Machine
Time-lapse microcontroller board Robotics
Photography powered b
y the
Watch life on fast forward sun’s rays
DESIGN
When Pico came out in January 2021, there was one feature Critical Media
requested more than any other – wireless networking. The criticalmedia.co.uk
Head of Design
problem is, while there was some spare space on the Pico Lee Allen
board, there wasn’t really enough for wireless. There also Designers
weren’t any spare GPIOs that could be used to connect the Sam Ribbits, Olivia Mitchell,
Ty Logan
wireless controller. These two obstacles didn’t stop the Photography
Raspberry Pi engineers, who ploughed on regardless. Brian O’Halloran
being moving the debug pins and a change to the LED. This Advertising
Charlie Milligan
month, we’re putting the Pico W through its paces with three [email protected]
44
question, or thought To subscribe
about HackSpace
PAGE
01293 312189
magazine?
hsmag.cc/subscribe
SUBSCRIBE
GET IN TOUCH
This magazine is printed on
hackspace@ paper sourced from sustainable
raspberrypi.com forests. The printer operates an
environmental management system
h
ackspacemag which has been assessed as
conforming to ISO 14001.
h
ackspacemag 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
www.dbooks.org
Contents 112
06 SPARK 31 LENS
06 Top Projects 32 Pico W Projects
Beautiful builds made by humans Build connected projects with the new board from Raspberry Pi
PICO W
PROJECTS 78 Turn programmatically stored
information into physical patterns
Make internet-connected
builds with the NEW $6
microcontroller board
104
32
4
CONTENTS
96
18
06
How I Made
BEAM robotics
20
Interview
Andrew Sink
74 SoM Raspberry Pi
Time-lapse photography on a Raspberry Pi
78 Tutorial Knitting
Knitting: it’s like coding, but with fabric
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. 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
www.dbooks.org
Top Projects
REGULAR
(Freddie) Mercury
thermometer
By TurboSnail hsmag.cc/FreddieMercuryThermometer
H
as there ever been a more captivating rock front
man than Freddie Mercury? No, of course there
hasn’t. That’s what makes this custom temperature
display so awesome. Well, that and the custom
PCB that forms the display, and the custom
microcontroller based on an Arduino Uno that forms
the guts of the build (along with a low-power servo and an Adafruit
AHT20 temperature/humidity sensor).
All together now: DAAAA-OOOOOOOOH!
Right
Freddie points at the
temperature with his
resin-printed arm
6
SPARK
7
www.dbooks.org
Top Projects
REGULAR
W
hen teacher Jean Noël showed his students
a record player upgraded with an Arduino
to read RFID tags on record sleeves, we
can only imagine their befuddlement. Kids
these days don’t use physical media; they
don’t even download anymore. At least, that’s
what we’re told. We don’t actually know any kids.
The students in question – Ibrahima, Scott, Antoine, and Arthur
– did recognise that the underlying technology is RFID, and they’re
working on making their teacher’s project even better, upgrading
the user interface to make it easier to use. Most significantly,
instead of uploading a new Arduino sketch to update the playlist
(something that requires coding skills), the user will be able to do
it by renaming MP3 files on the SD card (something that does not
require coding skills).
The students eventually plan to make the improvements scalable
as a kit form that they will be able to sell on Tindie. Bonne chance!
Right
Other improvements
in the pipeline
include an RGB
LCD screen to give
information to the
user and show some
cool light animations
8
SPARK
9
www.dbooks.org
Top Projects
REGULAR
W
orkshop Heaven, the online emporium of
woodworking delights, has listed among
its wares a hand plane going for £10,560.
It’s a beautiful tool, but is it more beautiful
than this handmade router plane built out of
scraps of wood in the maker’s workshop?
We’d say not. This build, by Instructables user WOmadeOD
comprises a chunk of hardwood, a square of steel plate, a nut, and
a bolt, which is shaped, hardened, and sharpened until it can take
off thin slivers of wood.
Right
To adjust the depth
of the plane, just turn
the bolt a fraction
of a turn
10
SPARK
11
www.dbooks.org
Top Projects
REGULAR
Raspberry Pi TV
simulator
By Pakéquis Pakequis.com.br
I
n this age of LED everything, it’s hard to imagine the tiny
CRT televisions that were once marketed as ‘travel’ TVs.
That’s what this is, only this has been retrofitted to include a
Raspberry Pi playing a selection of old black-and-white films.
Even better, when you change the channel, it produces an
authentic screen of white noise, just like TVs used to do.
Right
Movies are stored on
the Raspberry Pi’s
SD card, and there’s
an Arduino Pro Mini
to provide voltage
that the TV can use
12
SPARK
13
www.dbooks.org
Top Projects
REGULAR
3D-printed
bike light
By Kevr102 hsmag.cc/BikeLight
A
fter ‘do not crash’, our one golden rule of
riding a bike is that you can never have too
many lights. That’s what inspired Kevr102 to
design and build this auxiliary bike light for when
his existing front light runs out of battery. It’s a
3D-printed enclosure for a Kitronik 5 V LED lamp
kit, with the addition of a buck converter to drop the 6 V from the
AA batteries down to the 5 V required by the LEDs. And as the
maker notes, the square version “looks a bit like the weapon the
Predator has on its shoulder”.
Right
Kevr102 designed
this bike light in
Fusion 360
14
SPARK
1
5
www.dbooks.org
Top Projects
REGULAR
3D-printed
power loom
By Fraens hsmag.cc/PowerLoom
T
his issue, we’ve gone into the coding behind
knitting and crochet, and raised a hat to the
Jacquard loom, which took instructions that
could’ve been programmed anywhere, by anyone. It
wasn’t Turing-complete, but it was, almost, a computer.
This 3D-printed model pays tribute to the power
looms that laid the way for the Industrial Revolution and, indirectly,
computer science.
Fraens has made the STL files available on Printables and
Thingiverse, and there’s a full list of materials used on his YouTube
page, including screws, ball bearings, and a 12 V motor. Apparently,
one of the hardest things to get right was the weight of the shuttle:
too heavy and it won’t move; too light and it gets snagged easily.
Right
The Luddites would
never have smashed
a machine they
could have printed
themselves
16
SPARK
17
www.dbooks.org
Objet 3d’art
REGULAR
Objet 3d’art
3D-printed artwork to bring more beauty into your life
M
ost of the time, it’s a
pleasure to mow one’s lawn.
It’s a moment of communing
with the outdoors, of exerting
your mastery over nature.
Mowing the lawn is a lovely job – unless
you’re stricken with hay fever. Or, you have
extensive grounds that you just can’t be
bothered to look after (admittedly, this
would be a nice problem to have).
In these situations, a robotic mower
comes into its own – and TGD Consulting
has come up with a 3D-printed, Raspberry
Pi-controlled solution: PiMowBot. Like the
BEAM project featured on page 46, it takes
power from the sun, so the whole top panel
is a solar panel. You can get the design files
from Cults3D below.
hsmag.cc/PiMowBot
18
SPARK
19
www.dbooks.org
Electromagnetic Field 2022
REGULAR
Electromagnetic
Field 2022
Our roving reporter visits the UK’s biannual maker festival
E
very two years, the British summer is
lit up by Electromagnetic Field (also
known as EMF Camp). This maker
festival brings people together to show
off makes and talk about the things
they’ve been doing. Since 2018, this has
been held in Eastnor Castle just outside Ledbury in
Herefordshire (a county forever blighted by Robert De
Niro’s mispronunciation in the film Ronin: for our
international audience, it’s pronounced approximately
hair–re–ford–shire).
”
they’ve been working with
20
SPARK
21
www.dbooks.org
Electromagnetic Field 2022
REGULAR
Above
Sam Battle valiantly
pressing on
through some
technical hiccups
22
SPARK
BADGE
Every attendee got a programmable electronic badge.
Known as ‘TiDAL’, this featured an ESP32 processor Above
(with WiFi and Bluetooth), a small TFT screen, joystick, The Mammoth Beat
two buttons, three-axis accelerometer, three-axis Organ mechanical
modular instrument
magnetometer, and a battery. in action
You can create and install MicroPython apps from
the App Store. You can see the available software at
2022.badge.emfcamp.org. Options include a very basic
oscilloscope, some games, and a weather forecast.
The choice of MicroPython and an online editor
meant you didn’t have to install any software to
linear way. A simplistic movement (such as waving create your own apps. Just plug in your badge (which
featured a USB-C socket that slotted straight into a
an arm) doesn’t in itself result in a particular sound.
USB port on a computer – no cable needed), point
Instead, the computer tracks a range of movements
your browser to editor.badge.emfcamp.org, and you
and converts them into sound using a dancer- were ready to start coding.
specific ML model. This toolchain-less setup made it much easier to
Alongside these talks were workshops where start creating things while on site.
people could learn to solder, build, sew, blacksmith,
and other maker skills. The workshops took place
in ‘villages’ – these are self-organising groups of through the camping field stood a tower of button-
attendees. Anyone can start a village where they activated flaming torches, and more lasers than had
and others can camp together. Some villages any right to be in a field, lighting up the sky across
included larger tents and gazebos which were the whole event. Inside was a curious mash-up of
used as meeting places and general areas to relax nightclub, market, escape room, and interactive
and chat. art display. Oh, and there was a scanning electron
Standing apart from the rest of the main festival microscope as well. It’s the sort of place that defies
was Null Sector. At the end of a track that leads you easy categorisation.
23
www.dbooks.org
Electromagnetic Field 2022
REGULAR
Right
We’re slowly
building up the
skills to make our
own Hacky Racer
24
SPARK
THANKS!
EMF Camp is
the product of
hundreds of
volunteers. The
people who give
the talks, the
people who run
the bar and shop,
and even the
event organisers
are volunteering.
It’s the passion
that these people
bring that makes
the event special.
We’d like to
I was invited by race organiser Mark Mellors to give a heartfelt
have a go in the ‘Rule Zero’ fire engine. The racing thanks to all who
vehicles have a maximum width of 90 cm and length helped make this
of 150 cm, which results in quite a snug fit. After event great.
If you’re
wriggling in, I set about a few laps of the empty track.
thinking of
RACE-READY It was great fun. In the two weeks that I’ve been back attending in 2024,
One of this author’s personal highlights this year was home since EMF Camp, I’ve already bought two please consider
Hacky Racers. This is where people (or teams of broken ‘hoverboards’ to salvage motors from in order volunteering,
people) build small novelty electric go-carts and race to build my own. Look out for more on the build in whether that’s
them around a field. It’s broadly based on the Power future issues of HackSpace magazine. by giving a
talk, running a
Racing Series in the USA. Points are awarded for It’s difficult to sum up an event like EMF Camp in a
workshop, or
style as well as speed on the track, so designs few pages, but hopefully we’ve given you a flavour of
doing a shift in
included a giant Meccano vehicle, a cut-and-shut what it was like. If you’ll be in the UK in 2024, and are the bar.
Little Tikes car, and an Only Fools and Horses yellow interested in technology or making things, we highly
three-wheeler that appeared to be stuck in reverse. recommend you go.
25
www.dbooks.org
Letters
REGULAR
Letters ATTENTION
ALL MAKERS!
If you have something you’d
like to get off your chest (or
even throw a word of praise
in our direction), let us know at
hsmag.cc/hello
SUSTAINABLE MAKING
Alex Glow makes some very good points in
your interview with her last issue. Whenever I
make anything, I must go through a few
iterations before I get anything to work – that
means multiple PCBs made (with multiple
boards shipped from the factory), multiple
loads of solder, components, and, even when
they do work, everything needs a battery, with
all the pollution their production entails, and
that battery needs electricity. That all sounds
a bit grim, but one thing Alex said stands out:
“It’s not our fault, but it is our responsibility”.
We can try to do better without feeling guilty
about the 60–70 years of oil extraction and
plastics waste, because it’s overwhelmingly
the fault of a handful of companies. All we
can do is try to do better, and not let the
perfect be the enemy of the good.
James
Sunderland
26
SPARK
ROCKET GLIDER
The swing-arm rocket glider that your writer made last issue was brilliant, and
gave a perfect example of how the judicious application of 3D-printed parts to a
more traditional build can be so much better than trying to 3D-print the whole
thing. Dare I ask if we can hope to see more rocketry projects in the near future?
David
Germany
Ben says: As luck would have it, our Rocketry Correspondent, Jo Hinchliffe, is
right now working on a flat-pack rocket as a tutorial for the magazine — readers
are invited to think of a fake Swedish name for it, were it ever to arrive on the
shelves of IKEA.
PICO W
My MagPi subscription just dropped
through my door – and there’s a
microcontroller attached to it! Now I just
need someone to come up with a load of
projects for me to copy. Can anyone out
there help me?
Lucy
Bedfordshire
27
www.dbooks.org
Crowdfunding now
REGULAR
CROWDFUNDING
NOW
ShaRPiKeebo
The little computer with big battery life
B
uilding a portable computer is easier it’s mostly text-based – this is a great choice. The
than it’s ever been. With tiny single-board 400×240 pixel resolution might be a little small for
computers such as Raspberry Pi, you just graphical use beyond simple games, but for text-
need to find a small keyboard and screen based things, it looks like a great choice.
in the form factor you want, strap on a As well as a low-power screen and a 56-key
battery, and you’re ready to go. keyboard, the ShaRPiKeebo comes with a 433MHz,
However, there’s a big difference between long-range radio for sending data between devices.
building a computer and building a good computer, You can get these modules separately, so it should
and that comes down to be possible to build your
”
understanding your own hardware that can
needs and picking send data to your
The ShaRPiKeebo
exactly the right ShaRPiKeebo, making it
components for the job. looks like a great an interesting option for
The ShaRPiKeebo option for a battery- controlling hardware
”
is small and packs a across a long (circa 1 km)
long battery life. The powered handheld range. However, the
former is thanks to the module currently used
Raspberry Pi Zero W (the RFM95) is not
(or Zero 2 W), and the latter is thanks to the SHARP CE-marked, so can’t be shipped to the EEA.
Memory Display. This display is almost like a cross Overall, the ShaRPiKeebo looks like a great option
between e-paper and an LCD screen. It takes very for a battery-powered handheld, as long as you’re
little battery, and is just a single colour (like e-paper), mostly interested in working with a command-line
but has much faster update times (like an LCD interface, and we look forward to trying it out in
screen). For on-the-go computing – particularly if real life.
28
BUYER
BEWARE !
When backing a crowdfunding
campaign, you are not purchasing
a finished product, but supporting
a project working on something
new. There is a very real chance
that the product will never ship
and you’ll lose your money. It’s
a great way to support projects
you like and get some cheap
hardware in the process, but if
you use it purely as a chance to
snag cheap stuff, you may find
that you get burned.
Left
The SharRPiKeebo is
small enough to fit in
one hand
29
www.dbooks.org
enviro Flexible Power
Pico W Aboard
Alkaline NiMH Micro-USB LiPo
goes
Wireless, standalone boards
wireless
Human Friendly Working examples and custom libraries
https://pimoroni.com/envirow
Automation 2040 Your seven colour E Ink pal who's fun to be with
A B C D E
https://pimoroni.com/inkyframe
https://pimoroni.com/auto2040w PIMORONI
LENS
HACK MAKE BUILD
Uncover the technology that’s powering the future
CREATE
PG
46
HOW I MADE:
PG
32
BEAM ROBOT
Analogue, solar-powered
robotics – and it looks as cool
as it sounds PICO W
52
PG
PROJECTS
INTERVIEW: Add wireless power to your
Raspberry Pi Pico projects
ANDREW SINK
3D printing, photogrammetry,
and why you should print all
the Baby Yodas you like
PG
PG
60 64
IMPROVISER’S TOOLBOX: IN THE
BARBED WIRE WORKSHOP
It’s strong and spiky, but it’s also Summer is here, so
bendy – why barbed wire should it’s time to cook meat
be in your toolbox over a hot fire
www.dbooks.org
Pico W Projects
FEATURE
PICO W
PROJECTS
32
LENS
T
he Pico W is, rather
predictably, a Raspberry
Pi Pico but with added
wireless networking. For just
$6, you get a dual-core Arm
Cortex M0+ microcontroller
running at up to 133MHz with 264kB of RAM
and 2MB of flash storage, and on top of this is
an Infineon CYW43439 which adds wireless
networking (the chip also supports Bluetooth
Classic and Low Energy, but at present there’s
no firmware support for this).
All the things we’ve come to know and love
from the original Pico are still there. There’s
still a huge bundle of input and output options,
including Programmable I/O. In fact, the only
slight change is that the on-board LED is now
attached to the wireless chip rather than the
main microcontroller (see box on page 35).
Not only does it have all the old features, but
Pico W is in the same form factor as Pico, so
adding networking to a project is usually just a
case of swapping a Pico for a Pico W.
In this article, we’re going to take a look at
some great projects to help you get started and
get the most out of Pico W.
33
www.dbooks.org
Pico W Projects
FEATURE
W
hile Pico W is very similar to Pico, over, the drive will disappear and Pico W will reboot
you will need to get the special into MicroPython.
wireless version of the MicroPython We recommend Thonny for working with
firmware. You can download this from MicroPython (though you can connect over serial as
hsmag.cc/DocMicroPyth. well). If you haven’t already got this, you can download it
Make sure that you select the version for Pico W, as from thonny.org – it works on Windows, Mac, and
the version for the regular Pico won’t work. You should Linux (including Raspberry Pi). Open up Thonny and it
have a UF2 file, and this can be loaded onto Pico W. should automatically detect and connect to MicroPython
First, make sure that Pico W is unplugged from USB, running on Pico W. In the bottom box, you should see a
then hold down the BOOTSEL button and plug Pico W line something like this confirming it:
into your computer using a micro USB to USB cable,
Below MicroPython v1.19.1-88-g99c258977 on 2022-06-30;
The Thonny MicroPython then release the button. You should notice a new USB
IDE makes it easy to Raspberry Pi Pico W with RP2040
drive appear on your computer. You can drag and drop
program and transfer
files to your Pico the UF2 firmware file onto this drive. Once it’s copied If you see that, then you’re all set up and ready to go.
For our first internet-connected project, we’re going to
create a CheerLight. The idea of this is to have a
colour-changing LED linked into a global system of
setting colours. You can set the colour by tweeting
@cheerlights and including a colour name in the tweet.
This will change LEDs across the world to the colour you
name. In an increasingly divided world, having an LED
change colour is just a little reminder of how we’re all
connected. This can sit in the corner of your office and
remind you, in a small way, that you’re not alone. You’re
part of a worldwide community of makers.
We’ll be using WS2812B LEDs (also known as
NeoPixels) as our light. These can be programmed to
display a wide range of colours. These LEDs come in a
few different forms, but most commonly strips. You can
use any form you like.
First, let’s wire it up. Your LEDs should have three
inputs, usually in the order 5 V, Data In, and GND. 5 V and
GND should be connected to VBUS and GND on Pico W,
34
LENS
Left
You can program
Pico W from most
computers, including a
Raspberry Pi 400
ON-BOARD LED
The original Raspberry Pi Pico makes use of all the GPIO
pins. However, some are now needed to attach the wireless
module. One solution was to reassign GPIO 25. On Pico, this
while Data In should be on GPIO 18 (you can use another is attached to the on-board LED, but on Pico W, it’s attached
GPIO pin if you like, but you’ll need to change it in the to the wireless module.
code). You can solder these on or connect them with The LED remains, but now it’s controlled by the WiFi
jumpers and crocodile clips. module rather than the main microcontroller. Fortunately,
much of this is hidden by MicroPython, and there is a
pseudo pin called ‘LED’. You can blink the LED with:
CODING IT UP
We need to connect Pico W to the wireless network. import machine
Obviously, this needs an SSID (network name) and import time
password. You can put these directly in your MicroPython led = machine.Pin("LED", machine.Pin.OUT)
code, but this can be a bit inconvenient because it means while True:
you have to be a bit careful about uploading your code to led.toggle()
an online code repository, and it means you have to type time.sleep(0.5)
the details into the code each time you take them from a
repository onto your device. Instead, we’re going to use This pin should behave as any plain pin does, but it can’t
be used with PIO, PWM, or other special functions.
a secrets file. In this, we’ll put all the things that we don’t
want to be publicly known. It’ll include the WiFi login
details, as well as secret keys for things we’ll be using in
from machine import Pin
other examples.
from secrets import secrets
secrets = { import machine
'ssid': 'XYZ', import neopixel
'password': 'XYZ',
'aio_key': 'XYZ', ssid = secrets['ssid']
'aio_username': 'XYZ', password = secrets['password']
'ifttt_key':'XYZ',
} print("starting connection")
wlan = network.WLAN(network.STA_IF)
Enter that in Thonny and press Save, select
‘MicroPython device’, and call it secrets.py.
wlan.active(True)
Now, let’s connect to the network:
35
www.dbooks.org
Pico W Projects
FEATURE
Right
WS2812B LEDs come
in all sorts of shapes
and sizes, but they’re
all controlled in
the same way
OTHER LANGUAGES
We love MicroPython because it lets us get projects up while wait > 0:
and running really quickly. However, there are times when if wlan.status() < 0 or wlan.status() >= 3:
another language is more appropriate. break
wait -= 1
C/C++ The official C/C++ SDK is available at: print('waiting for connection...')
hsmag.cc/PicoSDK. time.sleep(1)
This supports networking through the LWIP networking
stack and gives you the ability to work with the networking
# Handle connection error
at a very low level. There are some examples to help you get
started at hsmag.cc/PicoExamp. if wlan.status() != 3:
At the time of writing, this is the only other language to raise RuntimeError('wifi connection failed')
support the wireless networking. However, we expect there else:
to be other options very shortly. print('connected')
36
LENS
else:
As long as we’re connected to the internet, we can
return None
use the urequests module to do just this, and the json
except Exception as e:
module will convert a JSON string to a Python dictionary.
print(e)
The following code grabs the latest colour from the URL
return None
and returns a colour:
return colour
def get_colour():
We have to do a bit of string manipulation to get the
url = "http://api.thingspeak.com/channels/1417/
colours out of the string. First, we use slicing to get the
field/2/last.json"
two hexadecimal digits that relate to the colour, then we
try:
add ‘0x’ to the start of these two digits. The ‘0x’ lets
r = urequests.get(url)
Python know that the string contains hexadecimal
print(r.status_code)
characters, so we can then use int() to convert this new
if r.status_code > 199 and r.status_code <
string into an integer.
300:
Finally, we just need a loop that checks the colour
cheerlights = json.loads(r.content.
every minute and updates the LED.
decode('utf-8'))
print(cheerlights['field2']) while True:
red_str = '0x' + cheerlights['field2'] print("getting colour")
[1:3] colour = get_colour()
green_str = '0x' + cheerlights['field2'] if colour is not None:
[3:5] pixels.fill(colour)
blue_str = '0x' + cheerlights['field2'] pixels.write()
[5:7] time.sleep(60)
colour = (int(red_str), int(green_str),
You can get the full code at hsmag.cc/cheerlight.
int(blue_str))
Load it up to your Pico and you should see the LED
occasionally change colour. Alternatively, tweet to
r.close()
@cheerlights and send a message to lots of devices –
return colour
including some Pico Ws – to change colour.
Left
Find out more about
CheerLights at
cheerlights.com
37
www.dbooks.org
Pico W Projects
FEATURE
DO SOMETHING
BUTTON
Use Pico W to control the cloud
N
ow that we’ve got data from the internet, The first part of this is to create an applet in IFTTT
let’s send some to it and create a button which we will trigger from Pico. Head to ifttt.com,
that sends a message to the internet to create a free account (if you don’t already have one), and
do something. Do what, you ask? Well, do sign in. You can then press Create to create a new
almost anything! The magic glue in this project is If This applet. The first part to configure is the If This part. Press
Then That (IFTTT), an online service that connects causes Add and search for webhooks. Inside this option, select
to events. This means that you can create a thing that Receive a Web Request, then give it an event name
triggers a huge range of possible events. In this example, (you’ll need to enter this in the program later on). Press
we’ll use it to control our heating using a Hive Create Trigger to finish the first part.
thermostat. However, IFTTT works with a huge range of Second, we create the Then That part. Again, click on
different web-connected devices, so you can easily Add. Here, you can configure your applet to do whatever
modify this to work with any device that’s supported. you want. We’ve configured ours to send us an email,
Take a look here for a full range of supported systems: but you might want to browse through the list of options
ifttt.com/explore/services. to see if there’s some particular service you’d like
If This Then That lets you create very simple programs to trigger.
without having to program anything. The programs are Now, let’s take a look at the Pico W side of things.
known as ’applets’ and all need to have the form ‘If this The only wiring is to connect a button. One side of this
event happens, then trigger this action’. There’s support should go to 3 V and the other side to GPIO pin 0.
Above
This code also works for lots of different possible events and actions. The We need to update our secrets file with a couple of
with the user button on particular event that we’ll be using is known as ‘Maker bits of information for IFTTT: the event name and key.
the Kitronik Autonomous
Robotics Platform for Pico Webhooks’. These create a URL that, if you visit it, will Technically, the event name doesn’t have to be secret,
trigger an ‘If This’. but the secrets file is a good place to put it.
38
LENS
'ifttt_key': 'XXXX',
'ifttt_eventname': 'web_button',
URL
https://maker.ifttt.com/use/<your key here>
39
www.dbooks.org
Pico W Projects
FEATURE
WEB SERVER
ROBOT
Control a buggy from the web
S
o far, we’ve looked at getting data from the data to Adafruit IO and another to read data from the
internet and sending data to the internet, but same feed. Doing this is reliable and you can keep a trail
in both cases, we connected to an external of data, should you need to restart one of the machines.
server. However, there are times where we However, it’s also slow, and there are times when you
don’t want to send data to an external system, but use might not want to trust your data to the internet.
a wireless connection to send data from one computer Fortunately, there is a solution. Hypertext Transport
to another. Protocol (HTTP) – the protocol that the web is built
In this case, you can go via the internet on – is actually a very simple text-based protocol.
– for example, use one A client sends a request to a server which
machine to send returns a response. The sort of web
servers that power most websites
are complex bits of software, but
this complexity comes from
performance and the features
that allow you to automatically
place dancing baby GIFs
on your web pages
and suchlike.
We can do away with all
that and have a really simple
web server that just controls
a buggy. We want it to serve
up the same web page
whatever address the user
puts in (which displays a
simple remote control), and if
they visit /buggy/forward, the
buggy will move forward. If they
visit /buggy/left, the buggy will go
left, and if they visit /buggy/right, the
buggy will go right.
We’ve used a Kitronik Pico Buggy for this,
but it should work with any robot that you have
Right a MicroPython library for.
There’s far more hardware
than we’ve used – you can The first part of the code is the same WiFi connect
add extra servos, an extra code that we’ve used in previous examples, but we’ve
distance sensor, and even
a pen for drawing added in a few LED flashes on the buggy’s four RGB
40
LENS
Left
This robot was
designed for Pico,
but since Pico W is
pin-compatible, it slots
right in and works fine
print("connecting ...")
LEDs so that we can see what’s going on when we’re
wlan.connect(ssid, password)
not plugged into a computer.
41
www.dbooks.org
Pico W Projects
FEATURE
Right
Power comes from four
AA batteries, which
means this can run
without any cables
42
LENS
43
www.dbooks.org
SUBSCRIBE
TODAY
FOR JUST £10
Get three issues plus a
FREE Raspberry Pi Pico
delivered to your door
hsmag.cc/FreePico
UK offer only. Not in the UK?
Save money and get your
issue delivered straight to your
door at hsmag.cc/subscribe.
See page 66 for details.
SUBSCRIBE
on app stores
From £2.29
Buy now: hsmag.cc/subscribe
Free Pico with print subscription only
Robot Beer
Roundup BBQ
RASPBERRY PI TECHNOLOGYTurn
SAVE
hsmag.cc July 2022 Issue #56 IN YOUR HANDS hsmag.cc June 2022 Issue #55
Make your a keg into
PICO W
Raspberry Pi move
Vinyl cutting an outdoor grill
44% PROJECTS
Get started with a
Cricut EasyPress
Aug. 2022
+ make a robotic h
wit
drawing machine co
Jason
Coon
Lube
BEAM
Issue #57 £6
Everything you
Raspber ry Pi Pi The Evil Geniu
s
Fibonacci LE of
wanted to know but Ds
were afraid to ask
tle,
Machine
Like the space shut
Make internet-connected
but smaller
Hydraulics
builds with the NEW $6 Move mountains with
Jun. 2022
Issue #55 £6
Jul. 2022
Issue #56 £6
www.dbooks.org
A solar-powered robot from old fashioned parts
FEATURE
HOW T
he term ‘BEAM robotics’ is
one that would have been
familiar to many makers in
the early 2000s, but has faded
I
into obscurity in recent years
with many of the old BEAM blogs and
forums lost to time. ‘BEAM’ does not
necessarily describe a specific form or
function of any robot, but rather an ethos
which is described in part by the name.
By Jack Spiggle The most widely recognised meaning of
the acronym BEAM is Biology, Electronics,
Aesthetics, and Mechanics. To me, two
further elements define BEAM electronic
design: the use of recycled components
MADE
(which I personally no longer do these
days, as new components are so cheap
and readily available), and the simplicity of
the circuits. These simple circuits are the
most striking difference between BEAM and
modern robots as BEAM robots lack any sort
of microcontroller. That’s right, we’re talking
analogue robots!
BEAM robots utilise a lot of passive
components and other fundamental
components like CMOS inverters, but
lack any kind of microcontroller. The most
complex BEAM robots are made up of
blocks that mimic neurons. That is, once
a certain stimulus threshold is met on
the input of each block, an action occurs.
A SOLAR-POWERED
ROBOT FROM OLD
FASHIONED PARTS
A design inspired by biology
46
LENS
THE ROBOT
Enough with the philosophy, let’s talk about
the robot. What does it actually do? It sits
in a glass bell-jar from IKEA, charging via
the large solar panel and turning to face
47
www.dbooks.org
A solar-powered robot from old fashioned parts
FEATURE
“ I ABSOLUTELY
It spends most of the day robot dismantlable in favour of permanent
sitting rather stationary, connections, in the hopes that the robot
only to move about quickly, will still be serviceable decades from now.
WITH BRASS ”
you pass your hand over Onto the electronics, and the circuitry
it. Sitting on my desk, it can be broken down into three major
generally wakes up around sections: the solar charging, the motor
8–10:00 in the morning control, and the whistle/dance circuit. A lot
and stops anywhere from of the robot was based on BEAM circuits
5–10:00 in the afternoon. To make it more originally designed by Wilf Rigter in the
interactive, I also added a circuit that early 2000s with a lot of modifications and
makes the robot do a little dance when you adjustments. The full circuit is much too big
give it three whistles. and nuanced to fully cover here, but there
is an Instructable and a half-hour YouTube
MECHANICS video overviewing the circuit in more detail.
The mechanical assembly of this robot The circuit is entirely free-formed,
is centred around the motors and the meaning that there is no PCB. Connections
solar panel. The motors are common N20 between components are created in
gear motors which were chosen for two three-dimensional space using bent brass
reasons: 1) if the robot is still operating wire, which I think looks stunning and
decades from now and a motor breaks, creates a kind of electronic, steampunk
there will likely be replacements available, vibe (BEAMpunk?). The process of free-
and 2) a wide variety of gear ratios were forming feels very similar to routing a PCB,
available to experiment with. In hindsight, and I find it quite therapeutic as long as
I wish I had chosen a higher-quality motor nothing goes wrong. Indeed, lots of testing
as the N20 motors are noisy and have was done throughout assembly to ensure
backlash that made the robot very hard to everything worked and a little confidence
tune. The motor mounts and other brass soldering goes a long way.
components were all made by hand using Interestingly, this robot actually took me
tools like a hacksaw, drill, soldering torch, longer to prototype and breadboard than
48
LENS
49
www.dbooks.org
A solar-powered robot from old fashioned parts
FEATURE
sample time. The solar engine on this robot MOTOR CONTROL CIRCUITRY
turns on at around 3.5 V and turns off again The motor control circuitry is really elegant
at around 2.5 V. When off, only the charging and was also (surprise, surprise) originally
is connected, and when on, the motor designed by Wilf. He called this circuit the
controller and microphone circuit turn on Power Smart Head (PSH), and one PSH
alongside a blue standby LED. is used for each of the robot’s axes. The
The DSSSE actually charges two PSH uses a modified CMOS oscillator to
capacitors: one is a smaller 330 mF create what I would describe as a PWM-
supercapacitor and the other is a larger based, proportional controller, with a large
7.5 F supercapacitor. The circuit starts by dead-band. The oscillator has two resistor/
charging the 330 mF capacitor so that, in capacitor (RC) pairs. The first RC pair
the morning, it takes much less time for dictates the oscillator frequency, and the
the robot to initially turn on and face the duty cycle of this oscillator is altered by a
sun. Once locked onto the sun, the panel pair of photodiodes that act as the robot’s
begins charging the 7.5 F capacitor until it ‘eyes’. This creates the PWM. The second
matches the 330 mF capacitor voltage, and RC pair creates the dead-band so that the
the two capacitors act as one. robot does not just constantly move and
50
LENS
WHISTLE/DANCE CIRCUITRY
The microphone circuit is based on yet
another Wilf design that he called ‘BEAM
Sonics‘. It consists of preamplification,
followed by some BEAM-style logic, again
mostly made of inverters and RC pairs. This
logic ensures that the whistles are of the
correct length, and that there is a distinct
pause between each whistle. Once it
“ THE SECOND
RC PAIR CREATES motors to locomote toward
light. Although the obvious
Above
The completed
THE DEAD-BAND”
solution is often to slap solar logic
a microcontroller onto
projects, there may be times
where simpler analogue
circuits make more sense. In
counts three suitable whistles, it triggers a fact, in recent years, analogue computers
circuit to make the robot dance and another are once again being considered for use in
to lock the whistle circuit for 20 minutes artificial intelligence!
so that the robot is not dancing too often Even without building a BEAM solar
and wasting power. The microphone circuit engine, the principle of storing charge from
has three LEDs: one green that flashes a solar panel in a capacitor until there is
for every whistle, one amber that flashes enough energy to do something useful can
when the circuit activates, and one red that be applied to many
remains on while locked. solar-powered projects.
The dance circuit is simply three I hope this article might
oscillators, two of which force the motors have inspired you to
to oscillate and the other to make a pink, consider solar power
hexagonal LED flash. for future projects, or
perhaps to try free-
CLOSING THOUGHTS forming, which can be
While BEAM circuits may take a little a fun way to bring a
more effort to build and are nowhere near little more artistry to
as powerful as a microcontroller, I would any project.
encourage anyone interested to do some
research, and give these old BEAM circuits
a look (the Wayback Machine might be your
friend here). If you are keen to build any,
I think that the best circuits to start with
are ‘pummers’ that charge during the day
Right
and slowly flash at night, and ‘photovores/ The two Power
photopoppers’ that hop about using two Smart Heads
51
www.dbooks.org
nd
Andrew Sink
INTERVIEW
A
HackSpace magazine meets…
Andrew Sink
in
3D printing professional, evangelist, and GoldenEye fan
A
ndrew Sink is a shining
evangelist for 3D
printing. He was there
during the 3D printing
boom of 2014, and
kept the faith while
the buzzwords died down and people
refocused on what the potential of the
technology was. He’s written software
to make design for 3D printing more
accessible to new users, and his work is
on the shelves of big retailers, without
you even realising it’s 3D-printed. He’s
on a mission: to bring 3D technology
to the world in a way that people can
understand intuitively. We’re very lucky
to have got a few minutes’ worth of his
insights to share with you here.
52
drew LENS
nkwww.dbooks.org
Above
Andrew SInk,
wearing a mask
of his own face.
Thankfully this
is the version
without makeup
53
nd
Andrew Sink
INTERVIEW
A
HackSpace: You’re obviously not just a college; we had one in the engineering lab, such a limitless technology. And it’s also
guy who uses 3D printing from time to and I saw it and instantly felt that this is very much in its infancy, and we’re still
time: you’re an evangelist. What excites the thing that I’m going to do for the rest of figuring out what it’s good for.
you about 3D printing? my life – it was such a very clear and One of my favourite books is Timeline
amazing technology. by Michael Crichton. It doesn’t discuss 3D
Andrew Sink: So, first of all, in my day job, I The applications were just immediately printing directly, but it talks about people
am a senior applications engineer for apparent. I was taking a class on who accumulate these things called
n
Carbon (carbon3d.com). Carbon is a 3D SOLIDWORKS as a 3D CAD program at the transcription errors, where they’re
printing technology company based same time; taking a model out of essentially turned into digital data
outside San Francisco. So my job is SOLIDWORKS, and then sending it to the streamed into a different area, and then
i
primarily interfacing with customers and printer and then holding it in my hands re-materialised as physical objects. And
designing parts for additive that same day was an absolute revelation. over time, veins don’t line up all the way,
manufacturing specific to the Carbon It absolutely just tied together all the work bones are slightly misaligned… you
process. I work on a team that’s primarily that I was doing in the digital world to the accumulate these errors over time. When I
involved with lattice structures, so I spend physical world. And it was immediately started getting involved in 3D scanning, I
a lot of time thinking how to design apparent to me that it was just such an just immediately thought of that book,
something that used to be a uniform block untapped technology. because it really breaks down a lot of these
of material, as a conformal lattice, core concepts really well. With
”
rather than a solid shape. photogrammetry, the thing you’re
I was just at an expo in Detroit, I saw it and scanning is going to be the thing
Michigan, and I actually brought a you’ve scanned, but it’s going to be
bicycle with us to our booth. And
instantly felt that different. It can be its own, you
it’s got a 3D-printed seat, which this is the thing know, tangible item. The questions
was designed by people on the that I’m going to you get asked all the time with 3D
team that I work on. And it’s scanning are, ‘how do I scan a
designed for mechanical response;
do for the rest of boat?’ And that’s a very different
”
it’s designed for comfort, it’s my life workflow from ‘how do I scan a
designed for printability. screw’, where you’re talking about
Thousands of pages of thought precision on the magnitude of
have been dialled into this lightweight microns versus metres. 3D scanning, just
bike seat, and then you look at it and go HS: And do you still have that same sense like 3D printing, means a lot of different
‘Oh, that’s pretty neat’. of wonder now that you use it day in, things to a lot of different people. So,
But what’s really exciting about working day out? where I spend a lot of my time is on the
at Carbon for me is I went into a bike shop accessibility and early entrance, so I think
to pick up that seat fairly recently. And it AS: I can’t walk by a 3D printer. I’ll stop a lot about somebody who’s never heard of
occurred to me that is the first 3D-printed and watch them for a couple of minutes. 3D scanning before. They’re going to go to
part I’ve seen on a store shelf, that was a My house is filled with printers. It’s just Google and type in ‘3D scanning’; what’s
retail product. And when I was in Detroit fascinating to see the industry evolve so the first thing that they’re going to see?
with my wife, for the expo, we stopped in rapidly in ten years – materials, software, And how is that going to be applicable to
at a Dick’s Sporting Goods [a big sports hardware. And it’s just, it’s a really them? So I’ve spent a lot of time making
shop in the USA]. And they had the Adidas cool experience. videos showing the process of
3D-printed midsoles, so they had shoes photogrammetry. How do you stitch
that have a 3D-printed sole. And so I HS: You’ve also been experimenting with photos into a model? How do you use a
bought my wife a pair. It’s cool to be able to photogrammetry, which goes one step LiDAR scanner to use sensors to detect
walk into a store and buy something that further – taking an object from the real how a model exists in space, and really try
was 3D-printed. world, putting it into the computer, then and break it down in a way where
taking it back out again. What are the somebody with no practical experience
HS: What got you into 3D printing in the applications for that? can solve their particular problem?
first place?
AS: The application of photogrammetry is HS: Photogrammetry sounds like
AS: I’ve been involved in additive hard. You could be sitting in a room something that’s really expensive to get
manufacturing for about a decade now. I looking at the first camera and saying, into. Do you need to have access to a lot of
first used a 3D printer when I was in ‘Well, what are we gonna do with it?’ It’s specialist gear?
54
drew LENS
nkwww.dbooks.org
Above
Incredibly, this isn’t
a drawn model,
it’s a scan of the
dragon shown on
page 58
nd
Andrew Sink
INTERVIEW
A
AS: Historically, it’s been very mirror: you don’t really get a picture of the HS: You have a YouTube channel where
expensive. But that’s because it’s been mirror, you just get a picture of everything you talk about 3D technology; you’ve also
computationally expensive. The hard in front of it. written some software to make it easier to
part is the software. That’s where the create 3D models, haven’t you?
industry has really lagged behind. A big HS: Did you use an iPhone when you
part of that is conflicting messages from made the mask of your own face? AS: Yeah, so I’m a big fan of low poly art. I
users, you know: I want to scan really grew up with GoldenEye, on the Nintendo
n
small parts, very detailed, and I also AS: That was actually done using a fairly 64. So, I have a very deep appreciation for
want to fly a drone around my house high-end industrial 3D scanner. A friend doing more with less. You look at the
and make a 3D model. Those two use of mine did it while we were at a trade textures of these models, and it’s like a guy,
i
cases are going to accumulate different show and we had a bit of extra time. I sat and that guy has a, you know, a texture on
amounts of data, and those are going to be on it for a while – what are you gonna do him. So if you see a face, it’s the eyes and
processed differently. with a scan of your face? And early in the the nose. And then he moves his head,
Right now, there are apps on the App pandemic, a company launched a bounty you’re like, oh, it’s kind of a rectangle
Store that are under $10, that you can use programme on a facial recognition spoof. shape, you know?
on pretty much any iPhone, a lot of It was something like $10,000 if you could One of the things I found was that there
Android phones, and create a 3D model beat their biometric verification, and I weren’t a lot of really intuitive workflows
within minutes. There’s this really great thought, well, I’ve got a really nice-looking for creating low poly art without using
picture – my wife and I were in scan of myself, it probably wouldn’t be a programs like Blender, which is very
Chinatown in Boston. And it was a perfect stretch to try and beat this thing. That powerful, but not very intuitive, so it’s very
day for 3D scanning – it was overcast, so became my Covid quarantine project. I difficult for beginners. I set out with a goal
the light was very diffused – typically, you was at home. I had some time on my to design a web-based app to make low
get really harsh directional light poly models. So the URL is
”
from the sun, which makes it hard lowpoly3d.xyz – the whole thing is
to scan stuff without adjusting the written in JavaScript. And you can
aperture settings on your camera.
This technology is so basically upload a 3D model and
And it’s just, it’s kind of a mess. accessible now then you can select the destination
We got this picture taken with that it took me maybe amount and remove a certain
us. I saw the statue right next to us, number of edges, and it collapses
and I was like, ‘Oh, that would be
ten minutes to the model into a low poly model,
a great 3D scan’. And it is, without walk around and which you can then download.
”
a doubt, one of the best scans get the photo set One of the reasons that I wanted
I’ve ever made; you can make out to work on the low poly site was
individual teeth on the sculpture. just because at this point,
This technology is so accessible hardware has pretty well
now that it took me maybe ten minutes hands. And so I thought, what would a outstripped software in 3D printing. We
to walk around and get the photo set, normal person do? I will make a hyper- have very, very well-made machines that
and then maybe another five minutes realistic mask of my face. are made very inexpensively across a
after it finished rendering to clean up the I was going back and forth to make-up wide range of technologies. But, on the
base. So, photogrammetry has absolutely stores to get all kinds of different products design side, you kind of have two options:
gotten to a point where it’s affordable, it’s to try and bring out highlights in the professional parametric CAD, and then
usable, and you can get up and running model. I was putting paint on the lips and more sculpting programmes, like ZBrush,
very quickly. stuff. It was creepy. It was absolutely or Maya. Those both have pretty steep
For photogrammetry, it’s really hard to awful. It worked in the sense that Google learning curves. So I wanted to create a
get pictures of shiny stuff: bronze, for Photos will recognise the mask as a tool that was easy to use, where
example, is terrible. Because it goes picture of me. So it will automatically tag somebody could say, ‘Hey, I downloaded a
between dark and very bright, there are me, which is cool. I’m able to set up an model, and I’m going to reduce the poly
almost no gradients in bronze. You’re iPhone with the fake mask, but I’m not counts. And now I’m going to print it out,
either looking at, like, gold, or you’re able to unlock it, so, whatever Apple uses and then it’s done.’ That was the goal. And
looking at black. And so a marble statue for face ID does recognise it as a face, but I’m always excited to see what people are
on an overcast day is just perfect. It’s it won’t recognise it as the same face making with it.
worked out great. 3D scanning shiny twice. Google recognising it as a face And then there’s also the STL to ASCII
objects is sort of like taking a picture of a though, that was a huge win. generator. Again, if you grew up
56
drew LENS
nkwww.dbooks.org
Above
Upload any 3D
image to Andrew’s
andrewsink.github.
io/STL-to-ASCII-
Generator to
generate ASCII art
57
nd
Andrew Sink
INTERVIEW
A
around the time that GoldenEye was out, commoditised at this point. You can buy consumers will be more incentivised
you’ve probably seen ASCII art as well. a printer that’s mechanically sound for to try them. There was this big boom in
You can upload a 3D model, and it’ll about $200. That part’s really easy, I think. like 2014, where every newspaper had a
basically apply a filter on top of that The improvements will come in the form think-piece like ‘is this the dawn of 3D
model that shows up as ASCII art. It’s of ease of use and quality of life upgrades. printing’? And it turned out that nobody
pretty cool. They’re both designed to be as So things like: can the printer tell you knew how to design for 3D printing, so
approachable as possible: you nobody was actually making their
n
”
just drag a model and start own stuff. For the last eight years
hitting buttons, you really can’t We’re still not or so, we’ve seen that hardware just
mess up. And I think that’s very continuously gets improved. A lot
really at a place
i
encouraging for beginners; of the slicing software has seen
maybe they’ve got a 3D printer where the design incremental improvement, but we’re
for Christmas and they want to software is still not really at a place where the
learn more about the modelling
matching that speed design software is matching that
”
side, but they don’t have access speed of improvement. So I think
to expensive or difficult-to- of improvement on the consumer side, as those
learn tools. quality of life features start to make
their way down, the less expensive
HS: What do you see as the future, when it’s out of filament? Can the printer printers and the software becomes more
or possible futures, in the 3D detect when it’s not actually printing? intuitive. I think that’s going to really help
printing multiverse? Those features are available right now drive adoption.
on more expensive machines, and I
AS: Let’s split this into two separate parts. think, as those become more prevalent, HS: And how about the industrial side?
On the hobbyist side, I think hardware is printers will become easier to use, and
AS: As the technology gets faster, the
materials become more durable, and have
better mechanical properties, you’ll get
to a point where you’re going to buy a
car, and your shifter knob is going to be
3D-printed, and you’re not going to know
it. Let’s say there’s a factory that makes
cars, and they find out that one of their
tail-lights – the bracket that they ordered
5000 of – doesn’t fit onto the frame, and
they need to print a shim. That is where
3D printing will come in and save the
day, because you can solve this problem
quickly, cheaply, reliably, without having
to make tooling to mould this thing. I see
a real future for 3D printing in solving
problems that are below the surface, not
necessarily in people buying things for
the novelty of owning things that are
3D-printed.
58
drew LENS
nk
Left
The same model
in lowpoly3d.xyz,
in high- and low-
poly forms
59
www.dbooks.org
Improviser’s Toolbox: Barbed wire
FEATURE
BARBED
WIRE Sharp, but pliable, barbed wire is ideal for
practical indoor and outdoor reuse.
Rosie Hattersley suggests getting creative
I
f you want to seem ‘alternative’, erect miles of fencing that wouldn’t blow down in
introducing barbed wire into the prairie winds or need costly maintenance helped
your decor is a handy short cut. landowners demarcate their territory and prevent
The practical, low-cost means of cowboys and cattle from ranging over and trashing
demarcating your territory is visual their crops. Native Americans, chased off their own
shorthand for both unashamed lands by fortune-chasers, were less enamoured.
Rosie Hattersley attitude and keeping those you dislike at bay. No Barbed wire was first introduced in the 1840s
@RosieHattersley wonder it’s beloved of warmongers and absolutists, and 1850s, while Joseph Glidden, a farmer from
as well as punks and edgy fashionistas. These Illinois, patented his version of barbed wire in 1873,
Rosie Hattersley writes days, specially produced barbed wire is often found improving on the version he’d seen at the DeKalb
tech, craft, and life artfully holding up displays of dried flowers rather County Fair by twisting two strands of wire together
hacks and tweets
than the original ‘razor wire’ type being deployed for for added strength and tension.
@RosieHattersley.
more straightforward practical purposes. This more robust version of barbed wire also
came in useful when the telecoms industry wanted
used to fence off homesteaders’ land” Electric and smart fencing has, to some extent,
replaced the need for barbed wire in agricultural
settings, but there are millions of miles of the
Although we associate barbed wire with keeping near-indestructible stuff on farms and in former
people or animals at bay or interned, it began as a war zones. Depending on the regulations where
game-changing agricultural material that could be you live, recycling such unforgiving material can
used to fence off homesteaders’ land from their be a challenge, and you’ll find plenty of online
neighbours. In the US Midwest, where trees were advice about how best to store it and to unravel its
either scarce or non-existent, being able to quickly deliberately tangled reels.
60
LENS
BARBED
WIRE
TRELLIS
T
urning a former fencing material Project Maker
into a gate or decorative trellis Dan Towell
might not seem a huge stretch, aka The
but there must be several hours’ Dusty Raven
work involved in unravelling and
Project Link
then artistically bending and hsmag.cc/
rearranging the spiky lengths of wire into a BarbedWireTrellis
61
www.dbooks.org
Improviser’s Toolbox: Barbed wire
FEATURE
62
LENS
Y
ouTube often comes up trumps are scarce. Melinda’s, aka Scrapmetalsheila, Project Maker
for ideas about what to recycle (scrapmetalsheila.com.au) excellent videos are an Scrap Metal
and what you might reasonably honourable exception. Armed with 100–200 m of Sheila
produce from said scrap item. barbed wire, engineering gloves rather than leather
Project Link
There are plenty of helpful video tips ones (since they catch on sharp objects), and a hsmag.cc/BarbedWireBall
on how best to unfurl, stretch, and bolt-cutter, Melinda demonstrates how to create
use (or roll up your unused) barbed wire rolls, but a beach-ball-size barbed wire ball. Having cut the
tutorials on how to achieve a barbed wire makeover wire into five 5-metre-long pieces, corralling the raw
materials and tying it in place with flexible wire help
you form the basic shape. After this, it’s a matter of
wrapping, securing, and tightening sections of wire.
Once complete, you could mount the ball on
a rock or plinth in the garden, wrap it with solar
lights, or dangle it from a light fitting and illuminate
it. Should chandeliers and other lighting catch your
imagination, there are lots of barbed wire versions Left
Note – while this is
to be spied in upcycling videos and blogs, but most beach-ball sized, we
omit how-to details. Scrapmetalsheila’s advice will don’t recommend
that it’s used as a
provide an invaluable guide. beach-ball
63
www.dbooks.org
In the workshop: Beer BBQ
FEATURE
IN THE
WORKSHOP:
Beer BBQ
By Andrew Gregory Combining two of our favourite things:
beer and barbecues
A
fter a butchery course a couple
of months ago, I had a freezer
full of meat; that meant I needed
to upgrade my cooking facilities.
I wanted the option to barbecue,
and I also wanted something with
a top that I could close too, so that I could use it as an
outdoor oven.
With this in mind, I trawled the internet for a nearby
second hand beer keg that I could simply cut in half
and stick legs on. Two candidates presented
themselves: a stainless steel beer keg an hour and a
half’s drive away, or a barrel made of non-specific
material, 50 minutes’ drive away. I chose the nearer
barrel. This was my first mistake. But we’ll come to
that later.
The barrels had been sitting outside a disused
brewery, and were not rusty, but covered in old paint
and something rust-adjacent. I set to work with a wire
brush attachment on an electric drill to get the worst of
it off, before marking out where I was going to cut.
This is where the shape of the barrel gave me another
problem: working out where the hinges would go for
the lid. As there was only one flat bit in the middle of
the barrel, I decided to cut it not in half, which would
have been easier, but in two unequally-sized pieces, so
that the sole hinge wouldn’t have to take too much
weight. I marked out the cutting lines, and set about it
with an angle grinder.
64
LENS
Above
We angled the leg attachments by a couple
of degrees for more stability
I set to
work with a
wire brush
attachment
me). Aluminium (and aluminium alloy, which is what it
turned out my barrel was made of) has a very low
melting point. Rather than cutting through the barrel,
the angle grinder was cutting a very short way; then
the heat from the cutting disc was melting the
aluminium dust, which was cooling on the cutting edge Right
Cutting off-centre
of the disc, clogging it, damaging it, and eventually made it easier
breaking it. A new approach was needed. to hinge
65
www.dbooks.org
Improviser’s
In the workshop:
Toolbox:
BeerPaper
BBQ plates
FEATURE
I had to go the barrel in no time, apart from the rims, which are
much thicker than the rest of the barrel, and which I
with a 40-grit saw cuts quickly, and so leaves a pretty rough edge on
the cut metal, so I had to go over the edges with a
40-grit sanding disc – at last, a useful application for the
Above
I marked out the
positions of the holes Above
to mount the hinge British Racing
while the barrel was Green means we
still in one piece can grill faster
66
LENS
Above
The highlights on the edge of this cutting disc are
re-formed aluminium dust. Those bits don’t cut
anymore; they just get hot Danger!
Angle grinders work by spinning an abrasive disc at very high
temperature, since we have no idea what the speeds. They throw up dust, sparks, and, if you’ve very unlucky,
aluminium is alloyed with. Charcoal burns at well over broken bits of grinding disc, which is why you should always
that temperature, at 1100°C, so there’s a medium use the right PPE when you’re using one. For us, that comprised
probability that, with the coals heaped at the bottom of of the medical-grade face masks that we’ve had spare since
Covid went away; a pair of padded work gloves; and a pair of
the keg, the fire will melt through and drop onto
safety goggles big enough to fit over the writer’s extra-large
whatever’s below. I say medium, because the spectacles. It’s uncomfortable, it’s hot, but that’s nothing
temperature of the air outside the barbecue will always compared to the discomfort of getting a chunk of broken angle
be well below 660°C, even on a very hot day, so grinder disc in your eye.
there’s always going to be some air to cool the exterior
– the worst that will probably happen is that it’ll get a
bit soft. To reduce the risk of even this happening, I Left
bought a sheet of 2 mm perforated steel and cut it to fit From left to right:
a cutting disc
so that it sits roughly two centimetres from the bottom straight out of the
of the barbecue at its deepest point; steel melts at packaging; a heavily
damaged, unusable
around 1300–1500°C, so as long as the hottest part of cutting disc; and a
the fire sits on the steel mesh, all should be well. Cross disc that got stuck
in the barrel and
your fingers for me. fragmented
67
www.dbooks.org
3 ISSUES FOR £10
+
FREE BOOK
hsmag.cc/hsbook
Subscribe to The MagPi, HackSpace magazine, or Custom PC. Your first three issues for £10, then our great value rolling subscription
afterwards. Includes a free voucher for one of five fantastic books at store.rpipress.cc/collections/latest-bookazines
UK only. Free delivery on everything.
FORGE
HACK MAKE BUILD CREATE
Improve your skills, learn something new, or just have fun
tinkering – we hope you enjoy these hand-picked projects
PG
74
TIME-LAPSE
PHOTOGRAPHY
PG
70
Videos for speed freaks
SCHOOL OF
78
PG
MAKING
Start your journey to craftsmanship
PG
84 PG
96
K40
PG
90
CAMERA
OPTICS
Make sure your mirrors
INFRARED
PHOTOGRAPHY
PRINTER
Because photos should
are aligned Photographs in the dark exist in the real world
www.dbooks.org
Upgrade your helmet
TUTORIAL
A
properly trained welder can earn Welding can be an uncomfortable hobby. There
a good living from their trade, are times when you’ll find yourself hot, sweaty, and
and putting that money into cramped into an uncomfortable corner, while you’re
good-quality equipment like a struggling to see the joint you need to weld through
welding helmet is a sensible your visor. Then, when you finally manage to get
move. For the weekend welder the weld, you need to raise your helmet and put on
Dr Andrew Lewis who spends more time holding a grinder than an safety glasses to finish up with an angle grinder.
electrode holder, it’s harder to justify spending It sounds miserable, but each of the problems
Dr Andrew Lewis is a a large chunk of cash on an item like a welding mentioned here can be solved, and some welding
specialist fabricator helmet. In this article, you’ll learn how a few simple helmets include solutions to these problems as a
and maker, and is the
owner of the Andrew helmet upgrades can make a big difference to your standard feature. Just because you’re working with
Lewis Workshop. comfort without costing a fortune. a basic model welding helmet, doesn’t mean that
70
FORGE
”
extension wires onto
71
www.dbooks.org
Upgrade your helmet
TUTORIAL
Above
Blowers are available
in a wide range of
voltages and sizes,
the light on or off by tapping the switch on the side
of your helmet.
The next modification for the helmet will help
” The thought of spinning
plastic blades near
but something around keep you cool, and will keep your visor (and glasses, to your face isn’t
”
a 50 mm 5 V blower
if you wear them) free from condensation. Adding
fan should fit into
most helmets fans to the helmet is easy to do, but you don’t just particularly comforting
QUICK TIP SPARE PARTS feels most comfortable to you. Faces and helmets
Check the position are all different shapes, but try to get at least one
You can buy replacement auto-darkening lenses quite
of your light on the fan blowing over the welding lens.
cheaply, and even units with built-in grinder buttons
helmet and give it a You can use the power cables that you soldered
and adjustable trigger settings aren’t that expensive.
quick test before you
However, if you’ve already got access to the parts you into the headlamp battery to power the fans, and
fix it in place. Check
need and the modification only takes a few minutes to all you need to do is add a suitable (chunky) toggle
you’re not blocking
complete, why spend more money? switch to turn the fan on or off. Positioning the
the recharge socket
for the lamp. toggle switch can be tricky on some helmets, but if
Right
If the case doesn’t
pull open with plastic
spudgers, you might
need to carefully cut
the plastic seam using
a sharp Stanley blade.
Don’t try to apply force
with the blade, just
make shallow cuts
along the seam. Once
you have a gap in the
seam, switch back
to using the plastic
spudger and picks
72
FORGE
BATTERY PROTECTION
If your headlamp uses a LiPo battery, you need to
figure out whether the battery is protected from excess
discharge or not. If a LiPo battery is drained too much,
it isn’t possible to recharge it again and will need to be
replaced. Some batteries have a discharge protection
circuit built into the battery itself, while others rely
on the attached electronics to deal with discharge
protection. If you’re not sure, err on the side of caution
and add a battery discharge protection circuit to
the fans.
73
www.dbooks.org
Turn your photos into time-lapse videos
TUTORIAL
TURN YOUR
PHOTOS INTO
TIME-LAPSE VIDEOS
Can we get to the good bit? Shooting time-lapse
videos makes drawn-out processes more engaging
G
Enable legacy camera support
ood things are usually worth the wait –
unless they come at the end of a long and
01 The functions we need to use in our
Nik
MAKER
largely repetitive video. In this workshop, Python code will run natively on older versions
Rawlinson we’ll show you how pairing Raspberry Pi with a of Raspberry Pi OS, but require legacy support if
Camera Module 2 and a PIR motion detector lets you’re running Raspberry Pi OS Bullseye or later.
Coffee-drinking,
typewriter lover you shoot stills only when there’s something To enable support in these versions, open a new
with a penchant for worth watching. Discover how to convert images Terminal window by pressing CTRL+ALT+T (or
pencils and paint.
into a time-lapse video packed with action. We’ve connect to your Raspberry Pi remotely using SSH)
Frequently found
staring at the sea been using this technique to show how time- and type:
from the back of consuming artistic processes result in a finished
a camper-van. image, but you could also use it to see what your sudo raspi-config
nikrawlinson.com pet does when you’ve left it home alone.
74
FORGE
support caused our at the scene we want to capture. Take a test photo
by returning to the Terminal prompt and typing:
saved images are
0kB in size, delete
75
www.dbooks.org
Turn your photos into time-lapse videos
TUTORIAL
Top Tip
Running
too slow?
FFmpeg defaults
to a framerate of
25 fps. To swap
it for 60 fps, add
‘-framerate 60’
before ‘-pattern_
type’ in Step 12.
uploaded images, as well as a user account that logs removing the # at the start, and adjust the number
straight into that folder. The process for doing this at the end of the line to correct the framing. Our
will vary between providers. Make a note of your camera is positioned with Raspberry Pi’s logo
username, password, and server address. printed on the baseboard in the top left corner,
so we need to rotate the image by 270 degrees to
correct its orientation. However, you may instead
need to make an adjustment of 90 or 180 degrees,
Supply your login details
07 Download the code from GitHub
depending on your setup.
76
FORGE
77
www.dbooks.org
A stitch in code
TUTORIAL
A stitch in code
The intriguing relationship between the fibre arts and coding
H
ave you ever considered how chain of interchangeable punched cards. In weaving,
a knitting or a crochet pattern a single weft thread is passed over and under a set
resembles coding, and the many of warp threads. Before this invention, workers had
parallels that exist between the to manually raise and lower wrap threads in order
fibre arts (an umbrella term which to create any kind of fabric pattern, and this was an
includes knitting, crochet, spinning, extremely slow process.
weaving, and yarn dying, to name but a few) and The cleverly designed cards of the Jacquard loom
Nicola King
coding? These two seemingly unrelated fields have were fed into the Jacquard mechanism at the top
@holtonhandmade an interesting history together and, in this article, of the loom and had small holes punched in them,
we will take a look at the fascinating similarities that which held the instructions for the weaving pattern.
Nicola King is a freelance really illustrate how much they have in common – They basically controlled which warp threads should
writer and sub-editor. spreading, we hope, an appreciation of the fact that be raised to allow the weft to pass underneath.
She firmly believes that
purchasing arts and coding and the fibre arts have many more similarities So, this was a very early example of instructing a
crafts goodies, and than you may ever have previously considered. machine to carry out an automated process, using
actually sitting down
and making something,
a binary system (with either a punched hole, or no
are two completely A CLOSE-KNIT RELATIONSHIP punched hole), where the information could be read
different pastimes. Let’s begin with a little history, which illustrates how by the loom and reproduced as required. The use of
coding/programming and the fibre arts are entwined. the replaceable punched cards to control a sequence
To see one of the most famous examples of this, of operations is widely held as an important step
we can simply look at the Jacquard loom, patented in the history of computing, as Charles Babbage
in 1804 by French weaver Joseph-Marie Jacquard. (1791–1871) was inspired by the Jacquard loom’s
Above The Jacquard system was way ahead of its time, use of punch cards to program his Analytical Engine
Fibre arts have a lot in
common with coding,
and enabled unskilled workers to weave intricate of 1837, considered by many as the first modern
as we shall explain patterns easily: the central principle being the use of a computer design. So, we can begin to see a link
78
FORGE
GRAPHGHANS
There is a stitch in crochet called C2C or ‘corner to
corner’, and each C2C stitch basically creates a small
square or block. This means that C2C is a handy stitch
to know if you want to design a pixel crochet blanket for
example (also known as graphghans – afghans made
from graphs), made up of a series of squares where
each square represents one pixel of the image. You
Figure 1
could write your own simple pattern for this on a piece The knitted swatch
of graph paper and then stitch it up. Or, you could use a illustrates a simple
lace design achieved
website such as Stitch Fiddle (hsmag.cc/PixelCrochet)
by following the
and create your chart there, where you can upload a dictated code and
picture to the site, or create a new design yourself. C2C various commands
therein. In knitting,
is similar to how computers store images in grids of stitches stay on the
coloured squares. needle and are active
What we are also illustrating here is that crocheters for a whole row, and
you use either single
and knitters are very happy to use tech help, including point, double point, or
websites and apps, in their designs if it makes the • R2 – 3 Ch, skip first 3 Tr *[2 Tr, 1 Ch, 2 Tr] in 1 Ch fixed circular needles
process easier – is your image of the average knitter sp, skip next 4 Tr, repeat from *, end by skipping
or crocheter evolving at all? It’s not just about the yarn Figure 2
last 2 Tr, 1 Tr in next Ch, turn The crocheted swatch
these days… • Repeat R2 until desired length – a different effect
is achieved from
(Abbreviations: Ch – Chain, Tr – Treble, Ch sp – Chain following the crochet
space, R – Row) code. In crochet, you
complete each stitch
here between the two, on first sight, seemingly very one at a time, so only
one stitch is live, and
different worlds. These are forms of code, knitting and crochet code: work with just a
sets of instructions used to complete several single hook
ILLUSTRATIONS OF CRAFTING CODE
Let’s now look more closely at the parallels between
coding and the fibre arts, and perhaps the easiest
thing to do to illustrate these is to take a look at
some very simple patterns which, when knitted
and crocheted, will produce the swatches shown in
Figures 1 and 2, respectively.
79
www.dbooks.org
A stitch in code
TUTORIAL
80
FORGE
”
of course used in coding
81
www.dbooks.org
A stitch in code
TUTORIAL
”
weareknitters.co.uk, or bytomdaley.com/collections
• Get yourself a book from the library – we suggest you grab a ‘How to’-type publication
along with a stitch dictionary, if you are learning crochet or knitting You can do both – you can
When you get that ‘light bulb’ moment, and everything finally clicks into place, you’ll feel
such a sense of achievement and you’ll be away (oh, and start making space for some yarn, code and program and you
fibre, tools… it’s a rabbit hole). You might even start designing your own patterns…also
can knit or crochet or
”
known as coding!
spin or weave
82
FORGE
Left
Africa Teen
Geeks’ Knit2Code
programme brings
together girls of
different generations
to learn, relearn, or
enjoy knitting and,
as a by-product, the
basics of computing
83
www.dbooks.org
Moving beyond the K40
TUTORIAL
E
ven the most highly engineered position as the gantry moves. The typical advice is to
products need to be configured use layers of masking tape or custom labels to see
correctly when they are installed, so where the beam is striking the mirror, but this isn’t
it’s no surprise that a homemade very useful if you’ve only just put the machine
piece of kit based on a K40 laser will together and the lasers aren’t even close to aligned. A
need some finesse and a few well- very slight change to a single mirror can shift the
Dr Andrew Lewis placed hammer taps before it will perform beam’s path by several feet over a relatively short
properly. In this article, you’ll learn some tips and distance, missing any masking tape or focussing
Dr Andrew Lewis is a tricks that will get your machine levelled, trammed, targets completely. Some expensive lasers use a
specialist fabricator
and maker, and is the and generally calibrated in the safest way possible. beam combiner to inject a low-powered visible laser
owner of the Andrew beam into the same path as the CO2 laser beam so
Lewis Workshop. DON’T LOOK AT THE INVISIBLE LIGHT that it’s easier to see exactly where the beam will hit
The most obvious set of calibrations that you need to an object, but these are typically an expensive extra
do with a laser cutter is aligning the mirrors. Ideally, that needs to be calibrated anyway.
this should be done after you’ve calibrated the gantry, A cheaper option for the home builder is to either
or you’ll risk having to start the whole mirror remove the lens and fire a visible laser through the
adjustment process again. Mirrors in the laser cutter system in reverse, or remove the laser tube
Above
The bigger the are angled to bounce the beam into the lens completely, and replace it temporarily with an
laser cutter, the regardless of the position of the laser head. Each appropriately mounted visible laser emitter. The latter
more difficult it
will be to calibrate, mirror is around 20 mm in diameter, so you need to be option requires more effort to calibrate the laser, but
because errors are accurate. The difficulty with calibration is that the the parts can be printed on a standard 3D printer and
amplified over the
long distances laser beam is invisible, and the mirrors change don’t need to be particularly accurate. The former
84
FORGE
”
a strong temptation to disable some of the interlocks
The burn mark will tell to make the process of calibration quicker. Do not
disable interlocks unless it is absolutely necessary,
you whether the beam because they are there to protect you from serious
harm. Invisible laser radiation can disfigure or blind
is striking the mirror in
”
you. The power supplies inside a laser cutter can
the centre or not generate high enough voltages to cook meat. You
are made of meat. Always wear laser safety goggles
when working with the laser, and be aware of the risks
caddy into one of the clamps for the laser tube, and from mechanical parts, high voltages, unexpected
fires, and reflective surfaces. Never leave the laser
position it so that the beam is parallel to both the
in a state where it could be activated accidentally by
clamps and the base of the machine. You can do this someone who does not understand the risks. Always
by measuring the distance of the beam from multiple have appropriate safety equipment nearby.
locations along the surface that the laser tube clamps
are mounted to, and the base of the machine. Your
emitter is aligned when the two measurements are the beam is bouncing to inside the laser chamber.
consistent along the length of the machine. With this Place your first mirror so that the beam striking it will
visible laser in place, it should be easier to see where be reflected to the next mirror at its furthest position
from the laser tube. Move on to position the next
mirror in the same way, and repeat this process for
each mirror. Move the gantry so that each mirror is
positioned in its opposite extreme, and repeat the
process until your beam is consistently visible on the
bed of the machine, regardless of the position of the
gantry. For the Z axis, remove the lens from the head
if it is already installed, and use a piece of tape to
mark the position of the laser beam projected onto
the bed, then lower the machine bed. Adjust the head
as necessary to get the laser point in the same place
at different bed heights.
Once you have the mirrors aligned with the visible
laser, you can remove it and place the CO2 laser tube
back into its clamps. In an ideal world the laser will
still line up and work perfectly, but in reality you might
need to do a more traditional calibration by placing
some masking tape or card over the first mirror and Left
A visible laser can
briefly firing the laser at its lowest power setting. The still be dangerous,
and you still need
burn mark will tell you whether the beam is striking to wear appropriate
the mirror in the centre or not, and then you can make laser protection when
working with them.
any minor adjustments to the lens angle and position The safety goggles
before tightening the bolts to lock it into place. Move for visible laser light
are different to those
the gantry to each extreme, and test the laser on a for the IR CO2 laser,
piece of scrap material. Hopefully everything should so make sure you’re
wearing the right one
line up correctly, but if you’re still having problems, while you work
85
www.dbooks.org
Moving beyond the K40
TUTORIAL
Above
Different types of bracket have different amounts of
adjustment. These large laser tube clamps can be
adjusted from side to side using the long bolt
channels, and can also be adjusted up and down using
the thumb screw in the centre. This adds an additional
layer of flexibility when aligning the beam, but it also
adds extra complexity. Some brackets have no
adjustment at all, and all alignment errors must be
corrected by the movable mirrors, which have a wide
range of adjustability
86
FORGE
UNDER TENSION
One source of errors in machines like 3D scanners
and laser cutters is slippage caused by insufficient
belt tension. Belt tensioners are critically important
to avoid errors while cutting or printing. You have
multiple options when it comes to belt tensioners,
ranging from springs that clip around the belt to pull it
tight, large sprung or weighted tensioner assemblies,
or integrated tensioners that include the idler pulley. It
doesn’t really matter which style you choose, as long
as you have one. Second to low belt tension, motors
skipping steps can also cause problems. If the belts
are too tight or bind on part of the chassis, the friction
may be enough to cause the motor to skip steps. Above
If you hear the familiar ‘clack-clack’ sound, check Actually measure the
your motors are wired correctly, and your belts are diameter of the laser
tube. The number on
running freely. the side of it is just a
rough guide
87
www.dbooks.org
Moving beyond the K40
TUTORIAL
88
FORGE
”
parallelograms. Testing the rails of the machine
for this is simple enough, and adjusted with shims
and involves using a large
If you’re getting ovals or if necessary.
engineering square with other strange shapes, With all of the
a known good right angle adjustments to the
you need to check your
”
to check the rails of the chassis and the mirrors
two axes are alignments again complete, you can insert
perpendicular. How you the laser lens and make
correct the problem will some low-power test
vary depending on how your system is wired. If each dots at the corners of the gantry. Each dot should be
side of your X axes has an independent motor with an crisp and round; if you’re getting ovals or other strange
endstop, then you need to adjust the endstop position shapes, you need to check your alignments again.
and rehome the axes to get them square. If you share Even a temperature change in the workshop can
a single motor for both of the X axes rails or only use be enough to push a laser reflector out of alignment,
one endstop, you’ll need to slip the pulley or the so you’ll need to recalibrate your laser every few
toothed belt around the shaft to better align the Y weeks, just to make sure that nothing has crept out
axes. Axes with a shared motor like this will need to of tolerance. Once you get the hang of it, you’ll be
be checked more frequently for slippage, as the able to get through the whole procedure in just a
controller’s homing process can’t correct any errors few minutes.
89
www.dbooks.org
Photographing the invisible
TUTORIAL
Photographing
the invisible
We can’t see it, but we can photograph it, as Mike Bedford
reveals in this hand-on guide to infrared photography
B
ecause our eyes are sensitive to Pi and one of its associated camera modules. Not
that part of the electromagnetic only are the results unusual but, we feel sure you’ll
spectrum that we call light, and agree, they’re impressive in the extreme.
since the cone cells of our retinas
respond differently to the various UNDERSTANDING INFRARED
wavelengths of light, we’re able to Infrared, often abbreviated to IR, is often thought
Mike Bedford see the world in full colour. But beyond the long- of as heat, but that’s not true of the whole infrared
wavelength end of the visible spectrum, that’s just spectrum. Heat is called thermal infrared, or
Despite loving all things after red, we find an area of radiation that’s known sometimes far infrared (FIR), but that’s not our
digital, Mike admits to
being a bit of a Luddite,
as infrared. Our eyes aren’t sensitive to infrared, of subject here. Sure, you can photograph thermal
vinyl records and all. course, so we might wonder how different the world infrared, but it requires specialised and expensive
would look if we could see this invisible radiation. equipment, and it’s mostly used for scientific or
In other words, what it would it be like to mimic technical applications, not for artistic pursuit.
the visual capabilities of some insects, fish, frogs, Instead, we’re going to see how to photograph
and snakes? The good news is that, by employing in the near infrared (NIR), which is the portion of
a special form of photography, we really can see IR just beyond the limit of human vision. The good
infrared and it’s not nearly as difficult as you might news is that the image sensors in digital cameras
imagine. Here, we’re going to see how to do that are sensitive to NIR. But to create images using only
using an ordinary camera and then, better still, by IR, we need to prevent visible light getting into the
making your own infrared camera using a Raspberry camera. This is done using a filter over the camera’s
Right
Using an ordinary
camera normally.
Middle: Using an
ordinary camera for
infrared photography.
Right: Using a camera
with no IR block filter
for infrared
photography –
this is the only
solution which
doesn’t filter out
most of
the infrared
90
FORGE
Left
The classic infrared
look is monochrome
but with high-contrast
dark skies, while grass
and foliage almost
seem to glow
GETTING PRACTICAL and I’ve had some good results. However, before
Using an ordinary camera with an IR pass filter gives buying an IR pass filter, do check that your camera
you an infrared camera which isn’t very sensitive or phone is sensitive to IR. I haven’t found one that
– so you need long exposures – but don’t dismiss wasn’t, although they do vary in their sensitivity, and
it. Until recently, I’d taken all my IR shots this way, older cameras might be better because they have
less effective IR block filters. A good way to check
is to observe the end of a TV remote control on your
camera’s LCD viewfinder – the end you point at the
TV – in a dim room while you press a button. Or, if
you have a DSLR that doesn’t use the LCD panel
as a viewfinder, you’ll have to actually take a photo.
If your camera can see infrared, you’ll see a small
bright circle at the end of the remote control unit.
If you’ve made sure your camera is IR-sensitive,
it’s safe to buy an IR pass filter – just search for
’IR filter’. A good choice is an R72 filter, which
has a 720 nm cut-off, because it’ll give you shorter
exposures than an 850 nm filter. If your camera has
a filter thread, the filter needs to be of the same
size or, if it doesn’t, like most compact cameras and
phones, just buy any filter that’s big enough to cover
the lens. Prices vary from about £8 to £100, but we
suggest a fairly cheap filter to start.
91
www.dbooks.org
Photographing the invisible
TUTORIAL
92
FORGE
Compared to some cameras, the resolution is so you have a portable unit. We’re not going to
modest, at 3280×2464, but you could easily find suggest exactly how to do that, because some of Above
Just as red, green,
that adequate, indeed we concentrated on it here the decisions are matters of personal choice, and and blue pixels have
because it’s such a cost-effective way into blocking- there are lots of published designs to choose from. different peaks in the
visible spectrum, they
filter-free IR photography. However, for unexplained Most of those designs will use an ordinary Camera do in the infrared too.
reasons, we experienced blurring towards the edges Module v2, not the NoIR version, or an unmodified This means that, if
your camera has its IR
of the photos. A better alternative would be based HQ Camera, but swapping a Camera Module v2 block filter removed,
on a Raspberry Pi High for a NoIR camera or you can capture false
”
colour information in
Quality (HQ) Camera. It removing the filter from the infrared. These
graphs are typical,
has a higher resolution, an HQ Camera barely
Using a NoIR or HQ but will differ
larger sensor, and larger impacts the design. between cameras
interchangeable lenses Camera Module requires a About the only addition
which have adjustable you’ll need – and this
bit more work than with an
”
aperture and focus, only applies to the
and is still affordable. ordinary camera NoIR because the HQ
There isn’t a version Camera lenses have
without the IR block filter threads – is some
filter, but it’s a fairly simple job to remove it, and means of attaching the IR pass filter over the lens. If
there are instructions on the Raspberry Pi website, you don’t need to use the filter elsewhere, you could
although it does invalidate the warranty. The working glue it in place; otherwise, glue on a filter stepper
of a camera with no internal IR block filter, but an ring so that you can screw the filter over the lens.
external IR pass filter, is shown in the third part of
the diagram on page 91. INFRARED COLOUR
Using a NoIR or HQ Camera Module requires a bit Conventionally, infrared photos are monochrome,
more work than with an ordinary camera because but there are several ways of creating colour IR
it needs to be housed together with a Raspberry shots. The methods involve post-processing and
Pi board, an LCD panel, and a power supply, you’ll need a fully featured editor but, if you don’t
93
www.dbooks.org
Photographing the invisible
TUTORIAL
”
have one, we suggest GIMP, which is free. We don’t
have space to provide step-by-step instructions, but
Remember, though, that we’re processing the invisible
we’ll give enough guidance for you to figure it
”
so there’s no correct way for these photos to look out yourself.
With an ordinary camera, i.e. one with an internal
IR block filter, the methods involve taking two
photos, an ordinary one and one taken with an IR
pass filter over the lens, and combining them. One
of the best ways is to split the normal photo into
hue, lightness, and saturation channels, discard
the lightness channel and replace it with the
monochrome infrared photo before recombining
them to make a colour photo. The colours will be
normal (-ish) but with the classic features of an
infrared photo, like dark skies and bright foliage.
The second method – which we call false colour
– requires only an infrared photo, but it should have
been taken on a camera with no IR block filter. The
graph on page 93 helps you to understand how
this works. It shows how a typical camera, not any
particular one, responds to different wavelengths.
We can see that the camera has peaks for red,
green, and blue in the visible part of the spectrum,
as we’d expect, but the camera’s red, green, and
blue pixels also react differently to different parts
of the IR spectrum. In other words, there is 'colour'
– although we don’t use that word in its strictest
sense – in the infrared. If the camera has an IR block
94
FORGE
filter, though, the camera will only be sensitive to a have to experiment. So, in post-processing, define a
small part of the IR spectrum, between where the white point from an area of the photo that ought to
IR pass filter (e.g. R72) starts and where the IR block be white – for example, clouds or grass. This should
filter ends. In our graph, that’s from about 675 nm remove the red cast by boosting the green and blue
to 780 nm and, since the red, green, and blue pixel pixels. Because the sky will be red or brown rather
sensitivities don’t change a lot in that range, you can than blue, though, it’s common to swap the red and
see why it only works well if the camera has no IR blue channels. The sky will now be blue and, while
Above
block filter. foliage will be very light like IR monochrome photos, We prefer the false
Straight out of the camera, images will probably it might have a pale orange, yellow, or pink hue colour effect that
renders grass and
have a strong red or magenta colour cast, after which many people think is a good look. Remember, foliage in a pale peach
all, as we can see from the graph, the red pixels though, that we’re processing the invisible so there’s or apricot colour, but
the effect with almost
are the most sensitive to IR. However, the actual no correct way for these photos to look, so feel white vegetation is
colour depends on the setting for white balance free to experiment to your heart’s content, perhaps quite pleasing too,
and no, that’s not
and whether you shoot in JPEG or RAW, so you’ll increasing the saturation and adjusting the hue. snow on the ground
95
www.dbooks.org
Make a printing party camera
TUTORIAL
Make a printing
party camera
Create a camera that sends pictures to a portable Bluetooth printer.
Use it at parties (or anywhere else) to capture the fun
T
hese days, no big social occasion The printer is a battery-powered device that
is complete without a photo booth provides a Bluetooth endpoint that can accept
where guests can take instant image printing commands. There are lots of low-
pictures of themselves. Now, you can cost ‘receipt‘ and personal printers available. The
make your own device to do the same ‘MobilePrinter’ that the author used was purchased
thing. It will detect when subjects for around £15 ($18), and works well enough.
Rob Miles arrive and offer them the chance to immortalise The camera can be powered via the micro USB
themselves on 57 mm-wide thermal paper with connector on the TTGO ESP32 module. You can add
@robmiles
the touch of a button. The camera and the printer an internal battery which should be large enough
are connected wirelessly over Bluetooth, and both to keep it going for a few hours. There is no power
Rob Miles has been
playing with hardware
devices are battery-powered. So, you can turn any switch. The camera switches on when the passive
and software since event into a picture party. The picture quality is not infrared (PIR) sensor detects a person. When the
almost before there was the best, but it does provide a recognisable and camera awakens, it displays a start sequence and
hardware and software.
You can find out more unique memory. invites the user to press the button on the front to
about his so-called life take a picture. Pressing the button starts a five-
at robmiles.com and
second countdown, after which a picture is taken
follow him on Twitter at
@robmiles and printed. The camera automatically powers down
after 30 seconds of inactivity. The OLED screen
displays large friendly messages to keep the user
informed of what is going on. You can find all the box
design, parts list, and all the software on the GitHub
site for this project here: hsmag.cc/PartyCamera.
96
FORGE
YOU’LL NEED
Bluetooth
thermal printer
Search for ‘Mini
Portable Bluetooth
Thermal Printer’.
They are usually
supplied with a
small roll of 57 mm-
wide thermal paper.
You can get more
from any office
supply shop
ESP32 camera
board. The ‘TTGO
ESP32 camera’ unit
is perfect for this
project. It has a
display and a PIR
sensor to wake up
the camera. Search
Figure 1 for it by name
The battery is glued to
the inside of the case Battery. The TTGO
using double-sided device can connect
sticky tape to a rechargeable
battery. Search for
You could instead solder wires to the back of the the display is quite simple, but setting up the PIR ‘1000mAh 802540
3.7 volt’ if you want
connector, or you can buy a cable (search for ‘LilyGO sensor is more interesting: one that works with
TTGO camera cable’) which plugs into the connector. the case design
Figure 2, overleaf, shows the front of the TTGO #define PIR_PIN 33 A button to
module. On the left of the board is the micro USB activate the
connector, next along is a PIR sensor, followed by void setup_pir() camera. Search
for ‘24mm arcade
the camera and 128×64 OLED display. There are {
button’. The author
also two push-buttons: one is connected to the pinMode(PIR_PIN, INPUT); used wire-wrap
processor reset and the other to General Purpose esp_sleep_enable_ext0_wakeup((gpio_num_t)PIR_ wire to connect the
button to the TTGO.
Input/Output (GPIO) pin 34. The GPIO button could PIN, HIGH); You can also get
be used as a shutter button for the camera, but it } a connector that
you can use rather
was decided that a large arcade button would be
than wire wrap.
more fun and easier to press. The code above shows the function setup_pir that Search for ‘TTGO
sets up the PIR sensor. The symbol PIR_PIN specifies camera cable’
STARTING UP THE CAMERA SOFTWARE the GPIO to which the sensor is connected. On A box. There is a
The camera is controlled by a program written in the TTGO board, the PIR sensor is connected to 3D-printable design
available. If you want
C++ using the Arduino software environment inside GPIO 33. The first statement in setup_pir sets this
to put the camera
a PlatformIO project. The code contains a setup pin to be an input pin. The second statement uses on a tripod, you will
function to start the device and a loop function the esp_sleep_enable_ext0_wakeup function to tell the need a 3/8" to 1/4"
camera adapter
which is called repeatedly when the device is active. ESP32 to wake up and start running when the PIR which you can
sensor lifts PIR_PIN high. The next thing the setup search for by name
void setup() function does is make sure there is someone there
Screws. You’ll need
{ to photograph. some screws size M2
Serial.begin(115200); 4 mm in length to fix
the TTGO device to
setup_shutter(); if (!digitalRead(PIR_PIN)) { the case (search for
setup_display(); go_to_sleep(); ‘laptop screws’)
setup_pir(); }
Micro USB cable.
You program and
The above code shows the beginning of the setup The code above tests the PIR input. If the input is power the camera
via the micro
function which sets up the shutter input, OLED low, this means that there is nobody in front of the USB port on the
display, and PIR sensor. Setting up the shutter and camera so it should shut down. TTGO module
97
www.dbooks.org
Make a printing party camera
TUTORIAL
Figure 2
The TTGO board
can be bought with
one of two different
camera lenses. This
board is fitted with
the ‘fish-eye’ which
gives a very wide field
of view. For pictures
of individuals, the
‘normal’ version
works better
98
FORGE
PICTURE QUALITY
A thermal printer works by heating up elements
in the print head which cause chemicals on the
printer paper to turn black. When printing text, the
amount of ‘black’ that needs to be printed at any
time is quite small. However, when printing images,
there may be quite a lot of black to print, and not all
printers handle this equally well. The image to the
right shows the result of trying to print a completely
black image on the thermal printer used for this
project. You can see how the print head has ‘given Left
up‘ towards the end of some of the rows. The The image should be
completely black. The
author is quite happy with this level of quality for bands are caused
the price, but you might be able to find printers that by the print head
can produce better results. overheating, or by
the limitations in the
power supply
attempts. If the setup works, the function returns from another Bluetooth device, find the printing
true, otherwise, it returns false. service, and then send text to it.
The screenshot in Figure 3, overleaf, shows
if (!try_setup(try_setup_camera, 200, 5)){ the text ‘hello world’ being sent from a mobile
esp_restart(); phone into the MPT-II printer using a program
} called ‘BLE Scanner’ from Blue Pixel Technologies
(bluepixeltech.com). This is an excellent way
The code sample above shows how try_setup to discover the services and characteristics of a
is used to call the try_setup_camera function five Bluetooth device. You can see parts of the very
times, with a 200-millisecond delay between large numbers that are used to identify services
each attempt. If a call of try_setup returns true and characteristics. We could write our own code
(indicating that the camera has been set up), the to drive the printer, but it is much easier to use a
program continues running. If a call of try_setup library written by Larry Bank, which you can find
returns false, the function esp_restart is called to here: hsmag.cc/ThermalPrinter. This finds and
reset the device completely. The program also uses connects to Bluetooth printers and works a treat.
try_setup to connect to the printer. We have already The only change the author needed to make to the
seen that each time the device resets, it will check library, to make it work with his printer, was to add
to see if there is anyone in front of the camera the printer’s name (MPT-II) to the list of printers the
before continuing. This means that if the printer library supports. There are instructions on how to do
is not powered on, the camera will keep trying to this on the GitHub site for this project.
connect until it detects that nobody is trying to take a
photograph, at which point it will shut down. bool try_setup_bluetooth_printer()
{
PRINTING OVER BLUETOOTH if (tpScan()){
A Bluetooth device exposes services, each of which if (tpConnect()){
contains several characteristics. A client connects tpSetWriteMode(MODE_WITHOUT_RESPONSE);
to a service and can send messages to the service return true; QUICK TIP
by writing values into a characteristic which are } The camera unit on
then picked up by code in the service. Services and else{ the TTGO module
characteristics are identified by large numbers. A return false; just ‘dangles’ on the
particular value means “this is a printer service” } ribbon cable, which
and another value means “this is a characteristic } can make for wobbly
pictures. Use a small
that accepts text to be printed”. In addition, each else{
piece of double-
Bluetooth device has a specific ID which is a string return false; sided sticky tape to
of text. The thermal printer used for this project has } hold it in place on the
the Bluetooth ID ‘MPT-II’. You can connect to this } TTGO board.
99
www.dbooks.org
Make a printing party camera
TUTORIAL
TAKE A PICTURE
The second statement in the loop function calls the
update_shutter_button function to check if a picture
Figure 3 should be taken.
You need to send a
message containing
the hex value ‘0a’ (line void update_shutter_button()
feed) to get the printer {
to print text you
have sent it bool new_shutter = digitalRead(SHUTTER_PIN);
if (last_shutter_input != new_shutter) {
The preceding code shows the try_setup_bluetooth_ if (new_shutter == 0) {
printer function which connects to the printer. The take_picture_and_print();
tpScan, tpConnect, and tpSetWriteMode functions are }
part of the thermal printer library. last_shutter_input = new_shutter;
Once the camera has been set up, the update }
function is repeatedly called to operate the camera. }
Let’s look at that next.
The code above is for the update_shutter_button
PHOTO LOOPY function. This detects when the button has been
void loop() pressed down by comparing the new shutter input
{ (new_shutter) with the last one (last_shutter_input).
update_timeout(); If the two are different, the button has changed
update_shutter_button(); state. If the new state of the button is 0, this means
delay(10); that the button has been pressed down, and the
} camera must take a picture and print it. This action
is performed by the take_picture_and_print function.
The code above shows the loop function for the This function displays a smile countdown and then
camera. First, the loop function calls update_timeout calls the functions take_picture and print_picture to
to check if the camera should shut down. produce the picture output.
100
FORGE
Left
void take_picture() The AI Thinker
ESP32-CAM board
{
is a good match for
frame_buffer = (uint8_t *)cam.getfb(); the TTGO device
frame_buffer_size = cam.getSize();
} return 1; // Continue decode
}
The code above shows the take_picture function
which sets the frame buffer and frame buffer size by The code above shows the printRows function, which
activating the camera. sends image bytes generated by decodeDither to the
printer. Each byte in the image data gives the state
void print_picture() of eight dots across the printed row. These need
{ to be inverted because the camera image uses a
if (jpg.openRAM(frame_buffer, frame_buffer_ set bit to indicate white, whereas the printer uses
size, printRows)) a set bit to indicate that a black dot is to be printed.
{ The buffer is assembled and then printed by the
jpg.setPixelType(ONE_BIT_DITHERED); tpPrintBuffer function.
jpg.decodeDither(ucDither, JPEG_SCALE_HALF);
} GOING FURTHER
} There is a lot of scope for extending this project. You
can use the printer to add bar-codes, QR codes, and
The print_picture function shown above prints the text to an image. You could create a ticket creator
image stored in the frame buffer. It uses another application which has a picture of the ticket holder
library written by Larry Bank. The JPEGDEC and a QR code holding the URL for the event. Or a
(hsmag.cc/JPEGDEC) is used to decode the image simple photo ID. The author hopes that you have
from the camera and send it to the printer. The learned some tips about creating devices that power-
print_picture function sets up the JPEG decoder up automatically, capturing images and using a
and then uses the decodeDither method from Bluetooth printer from an ESP32. And just maybe, if
JPEGDEC to decode the image from the camera. you make the party camera, you might get invited to
As the image is decoded, decodeDither calls the even more parties. Below
printRows function to send rows of image data to You can screw a
3/8 tripod adapter
the printer.
PRINTING TINY TEST PIECES into the bottom of
the case so that
the camera can be
int printRows(JPEGDRAW *pDraw) It is often a good idea to print parts of a design to make attached to a tripod
{ sure that they fit before you print the entire thing. Below,
int i, iCount; you can see a test piece that was created to make sure
uint8_t *s = (uint8_t *)pDraw->pPixels; that the opening in the camera base was the right size
for the USB plug. It is very easy to use a CAD tool to cut
large chunks away from your design so that you can
tpSetBackBuffer((uint8_t *)pDraw->pPixels,
print just small test parts to make sure that they fit.
pDraw->iWidth, pDraw->iHeight);
iCount = (pDraw->iWidth * pDraw->iHeight) / 8;
for (i = 0; i < iCount; i++){
s[i] = ~s[i]; // find inverted patterns in s
}
101
www.dbooks.org
FIELD TEST
HACK MAKE BUILD CREATE
Hacker gear poked, prodded, taken apart, and investigated
PG
112
WAVESHARE
LORA 104
PG
BEST OF
Adding distance to your
wireless communications
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 www.dbooks.org
Raspberry Pi Bots & Rovers
BEST OF BREED
ONLYTHE
BEST
Raspberry Pi
Bots & Rovers
Get your Raspberry Pi moving
T
he Raspberry Pi made waves when it In this Best of Breed, I wanted to look at some
entered the market, and for good interesting robotics kits and accessories that can help
reasons – it was affordable, powerful, you put that extra Raspberry Pi to use. Some of these
and relatively easy to use. We have kits have Raspberry Pis integrated, but most just need
come a long way since the introduction you to add one of your own to make it complete. And
of the original Raspberry Pi back in 2012. for those of you that are Raspberry Pi-less right now,
Now you have a choice of small form factor Raspberry keep your eye out for inventory online. I do see them
Pis such as Raspberry Pi Zero W and the incredible pop up from time to time, and at reasonable prices.
power you can unleash from Raspberry Pi 4.
But there is one issue plaguing the Raspberry Pi
community, and that’s availability. Although I can’t say
exactly how many Raspberry Pi boards have been
sold, I can say it’s a lot! But as of lately, they have
become difficult, but not impossible, to find in stock.
And it’s not just Raspberry Pis that have become hard
to find, it’s basically everything, especially electronics.
And it stinks!
But there are a lot of DIY-ers out there that have an
extra Raspberry Pi in their stash of electrical FRIENDLY
components. You might have torn apart an old project, TIP
or you had the foresight to order a few extra when Try rpilocator.com
they were easier to find. Remember those days? to help you find a
Yeah, me neither. Raspberry Pi online!
104
FIELD TEST
MonsterBorg vs
Trilobot Base Kit
PIBORG $257 piborg.org PIMORONI $54.12 pimoroni.com
T
he MonsterBorg from PiBorg is a and you are ready to tackle
robust robotics platform for your the outdoors. PiBorg
Raspberry Pi. It features a custom motor claims you will get up
driver: the ThunderBorg. This allows you to three hours of run
to easily control a variety of DC motors time on ten AA
directly from your Raspberry Pi. The kit batteries. Adding a
includes four high-torque 300 RPM metal geared camera, GPS, and some
motors, a well-designed aluminium chassis, 105 mm additional sensors could
off-road tires, and a mount for a Camera Module. make for a great autonomous outdoor
No soldering is required. All you need to do is add robotics platform capable of withstanding
your Raspberry Pi, almost any standard variant will do, a fair amount of abuse.
Above
For when the
going gets tough
T
he Trilobot from Pimoroni is a sturdy
Raspberry Pi-based robotics kit. It was
designed with educational use in mind,
so it also has great documentation and
example files. The Trilobot features VERDICT
2WD, breakout headers for additional
sensors and accessories, six-zone under-bot lighting, MonsterBorg
status LEDs, and a front-facing ultrasonic sensor for A very robust
measuring distance. robotics platform.
9 / 10
The PCB is labelled for ease of use, even for a
beginner. Pimoroni has a full-featured Python library to
help you get up and running quickly. You can pick up
the Trilobot with or without a Raspberry Pi, so if you
are lucky enough to have an extra one and want to Trilobot Base Kit
build a bot, this is a great choice. Just remember, if you Add a Raspberry
go for the version without a Pi and get going!
9 / 10
Raspberry Pi, you’ll also need a
Left battery and a USB card for your
We love the
clear wheels Raspberry Pi to get going.
105
www.dbooks.org
Raspberry Pi Bots & Rovers
BEST OF BREED
T
he pi-top [4] robotics kit includes 50+
metal build plates, two servo
motors, two encoder motors,
wheels, camera, ultrasonic sensor,
and the pi-top controller. It’s designed
for autonomous and AI-based robotic
projects. You can pan and tilt the front-facing camera
ultrasonic sensor, allowing for a full 180º view of the
surrounding environment.
At the heart of the robotics kit is the pi-top [4]. This
module can be purchased with or without a Raspberry
Pi, and the robotics kit can be purchased with or
without the pi-top [4] module. The module allows your
Raspberry Pi to run without wires and integrates a
five-hour internal battery. It also has a heatsink, fan,
UPS power circuitry, touchscreen, speaker, and easy
access to Raspberry Pi’s GPIO pins. It’s a very
professional-looking and well-made enclosure. Head
over to the website to download additional resources
and learn more about the different pi-top robotics kits
that are available.
VERDICT
Robotics
Superset with
pi-top [4]
Well-developed
hardware.
8
Left
Add some
/ 10 intelligence
to your robot
106
FIELD TEST
Maker Pi RP2040 –
Motor and Robot Controller
ADAFRUIT $12.50 adafruit.com
T
his one is a little different from the
other reviews in this Best of Breed.
No, not because it isn’t a full robot, but
because it’s not the typical Raspberry
Pi. This motor controller features the
relatively recently released RP2040 Left
You can also use
microcontroller, not a Raspberry Pi-based single-board a Raspberry Pi
computer. Either way, it still makes for a great central Pico W
brain for your next robot build.
The Maker Pi RP2040 features a dual-channel
DC motor driver, four servo motor ports, and seven VERDICT
Grove I/O connectors. It can control two brushed Maker Pi
DC motors or one stepper motor, providing up to 1 A RP2040 – Motor
current per channel. It also has an array of LEDs, so and Robot
you can quickly check the status of various digital Controller
I/O states. It also has an on-board piezo buzzer and computer and it will immediately start playing a Makes building
several push-buttons. friendly tune. Add a few motors, click some buttons, bots easy!
9 / 10
To get you up and running quickly, the board already and you’re able to test your setup before you build a
has CircuitPython preloaded and preprogrammed with bot. This looks like a great way to get started with the
a simple demo program. Just plug it into your RP2040, and best of all, they are typically in stock!
107
www.dbooks.org
Raspberry Pi Bots & Rovers
BEST OF BREED
RockyBorg
PIBORG $121 piborg.org
T
he RockyBorg by PiBorg features two
20 mm 180 RPM metal geared motors,
and a metal gear servo for leaning the
chassis into turns. It also comes with a
newly designed motor controller that is
compatible with your Raspberry Pi. The
body is made from laser-cut acrylic and features a
unique leaning motion that
would be interesting to see VERDICT
from the viewpoint of a
RockyBorg
forward-facing on-board
camera. The website has An interesting
bot platform.
more information, including
7 / 10
builds for controlling the bot
with a PS3/PS4 controller Left
Three wheels means
via Bluetooth. one less thing to
worry about
108
SUBSCRIPTION
RASPBERRY PI 2 ND E D I T I O N
Retro Gaming with Raspberry Pi shows you how to set up a
Raspberry Pi to play classic games. Build your own games console or
full-size arcade cabinet, install emulation software and download classic
arcade games with our step-by-step guides. Want to make games? Learn
how to code your own with Python and Pygame Zero.
REVIEW
M
aking a connected device just make a device part of a LoRaWAN application. In an
got a bit easier and cheaper application, messages are sent to a local gateway
with the launch of a module that which provides a connection to a LoRaWAN service
allows a Raspberry Pi Pico to use running in the cloud. You can set up your own
the LoRa network. LoRaWAN infrastructure, but most people use ‘The
LoRa – short for ‘long Things Network’ (thethingsnetwork.org), which is
range’ – is a great way to send data over free to access and underpins a huge number of
Below considerable distances whilst operating from community-operated gateways. You can check the
You get a lot of kit
for your money, tiny batteries due its low power requirements. gateway coverage in your area by using the TTN
including a LoRa You can use LoRa to pass small messages mapper site (ttnmapper.org). Your programs can
antenna and a
rechargeable battery between devices, but it is much more useful to interact with a LoRaWAN application in a variety of
ways, including MQTT (Message Queuing Telemetry
Transport) endpoints. The Waveshare board is
supplied with an example that transmits values from
the temperature sensor on the Pico. You can connect
”
rechargeable battery
112
FIELD TEST
Left
You have to solder
three extra pins onto
the top of your Pico
to connect the
debug signals
Below
This shows Visual
Studio running one of
the sample programs
that connects to
The Things
Network and sends
temperature values
to a LoRaWAN
application
Above
The device includes a power switch you can use to disconnect
the battery power. This is a great feature; it means that you can
manually power everything off without having to add power-
switching code in the program that controls the device
9/ 10
device to talk to it. of writing, Waveshare is aware of the problem
Before a device can interact with a LoRaWAN and an updated version of its software will be
application, it must first be added to the application. available soon.
113
www.dbooks.org
ON SALE
18 AUGUST
HACK YOUR
FOOD
Also
PICO W
3D PRINTING
LASER CUTTING
ELECTRONICS
AND MUCH MORE
hsmag.cc/subscribe
www.dbooks.org