3

(coco) #1
FORGE

Once you’ve connected everything up, the next step
is to attach the valve to the kettle. The valve you use
has a big impact on what bits you need to connect
it – the best thing to do is go to a physical shop and try
different bits until you have a setup you’re happy with.
We ended up using two 15 mm nuts with rubber seals
to connect the valve to the kettle, and a right-angle
15 mm tap connector to add a small spout to the ‘out’
side of the valve, which directs the water into a cup –
but it depends on the valve you get, and how big a hole
you want to make in the kettle. It’s a good idea to use
metal fittings so you can be sure they won’t melt.
Next, drill a hole in the side of the kettle to
accommodate the fittings for the valve. A stepped-
cone drill bit is the best way to do this. If your kettle
is plastic, it’s important to take things slowly and be
careful because the plastic cracks incredibly easily, and
if that happens it’ll ruin the whole kettle. Once you’ve
drilled the hole, fit the valve. Use a mole wrench or
spanner to tighten up the nuts really well – but not too
far or you’ll risk cracking the plastic.
Once everything’s connected up, it’s time to
program. Flash an SD card with Raspbian OS (there’s
a tutorial for this on the Raspberry Pi website at
hsmag.cc/UPSBIK), connect the Pi to a screen,
power supply, mouse and keyboard (you’ll need a USB
hub and a few adapters), and boot up. Note that you
absolutely mustn’t connect the 12 V power supply
whilst you’ve got your Raspberry Pi connected to
another power supply, or bad things will happen!

DON’T BAKE THE PI
The first step is going to be testing all the relays and
valves thoroughly. Fire up a Python IDE window (under
Raspberry Menu > Programming), and then open a
new window (File > New window).
Type the following code – if any of your relays
were active low, you’ll need to add the code
active_high=False in the brackets after the pin

TAKING THE (BEEF)CAKE
Once you’ve worked the valve out, it’s time to
do the same for the relays. You’ll need to solder
the Beefcake relay kit using the instructions on
SparkFun’s website at hsmag.cc/RKjTYl. It might
seem a little counter-intuitive to use two different
types of relay, but relays which can handle the full
13 A a kettle draws whilst boiling aren’t too common,
and it’s one place you really don’t want to be cutting
corners. You’ll need to work out if the relays are
active-high (if they turn on when their control pin
is connected to 3.3 V), or active-low (if they turn on
when their control pin is connected to ground). Keep
a note of which each one is – you’ll need to use it
when programming later.
The next step is to connect everything up according
to the diagram on the following spread. You’ll want to
solder wires directly to the GPIO of the Pi Zero W (no
header attached). Mount the 5 V regulator on a piece
of stripboard, and mark on which pins are for input
voltage, output voltage, and ground (you can find this
info by reading the data sheet for your regulator –
search for the name of the part). You should also use
a heatsink, and add capacitors to either side of your
regulator to smooth the voltage in case of any spikes;
the data sheet should have information on what’s
required. You’ll need to solder the connections to the
valve and pump, and use the screw terminals on the
relay for the rest. Leave out the kettle wire to begin
with, as it’s easier to test it without the relay.


YOU’LL NEED
Raspberry Pi
Zero W
A pair of low-
voltage relays
boardsebay.co.uk
A SparkFun
Beefcake relay
sparkfun.com
A kettle (the
simpler the better)
A water
container
2 V Solenoid
valve suitable for
100°C use
Small peristaltic
water pump
hsmag.cc/xmHijt
Small push-
button
5 V voltage
regulator
12 V power
supply (at least 3 A)
A small piece of
stripboard
Plenty of wire
The necessary
plumbing fittings
to connect your
valve to a kettle
and have it pour
into a cup

Below
Colour-coding wires is a great way to simplify things when
working on complex projects like this

Above
The Beefcake Relay kit is good fun to assemble, but you’ll need
a meaty soldering iron to make sure there’s a good connection
on the relay terminals
Free download pdf