This is only a preview of the August 2024 issue of Silicon Chip. You can view 45 of the 104 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "The Styloclone":
Articles in this series:
Items relevant to "Dual Mini LED Dice":
Items relevant to "JMP007 - Ultrasonic Garage Door Notifier":
Items relevant to "JMP009 - Stroboscope and Tachometer":
Items relevant to "Beer Can Filler":
Items relevant to "180-230V DC Motor Speed Controller Part 2":
Purchase a printed copy of this issue for $12.50. |
Beer Can
Filler
A
ny brewer will attest that the
tedious process of bottling or
canning the product can quickly erode
the joy of producing your own beer.
Commercial canning machines are
available, but even simple entry-level
units can go for thousands of dollars,
and fully automated machines cost
hundreds of thousands.
By contrast, this DIY version can be
built for a few hundred dollars using
commonly available parts from your
local hardware store and some online
electronics suppliers. It has proven a
reliable design for a craft brewery in
Melbourne’s south-east, where it has
successfully filled some 50,000 cans
over the last few years.
It even recently came to the rescue of
another craft brewery that faced spoiling an entire brew when their newly-
ordered commercial unit didn’t work!
Overview
This semi-automatic can filler is a valuable
tool for any home brewer. It can be built in
an afternoon for a fraction of the cost of a
commercial offering!
70
The key to reliable and repeatable
beer storage is to ensure there is no
oxygen inside the package when it is
sealed up. This canner works by displacing the oxygen using an inert gas,
typically carbon dioxide, which the
yeast in beer also produces naturally.
Most food-grade CO2 sold is the excess
produced by breweries. The fill process is thus:
1. Gas purge (around five seconds)
2. Pause (100ms)
3. Beer fill (around 20 seconds)
4. Pause (100ms)
5. Final Gas Purge (one second)
This is also shown in the state
machine diagram, Fig.1. Each state has
adjustable timers so that the machine
can be tuned for process variations due
to ambient temperature, gas pressure,
beer viscosity etc.
Two connections need to be made to
the machine, one to the carbon dioxide bottle and the other to the beer keg.
This design fills two cans at a time, so
each connection splits off at a tee and
runs to its own solenoid. We therefore
need to control four solenoids: left gas,
right gas, left beer and right beer.
The solenoids feed a pipe downstream that extends partway into the
can to administer the gas or beer, as
shown in the photos.
Circuit description
Project by Brandon Speedie
The brains of the operation is a
“smart relay”, which is essentially
a simple, low-cost PLC (programmable logic controller). It is well-suited
Australia's electronics magazine
siliconchip.com.au
Silicon Chip
Fig.1: the operation of the Beer Can
Filler is straightforward, as shown
in this flowchart/state machine
diagram. It is implemented using a
basic form of programmable logic
controller (PLC), a microcontrollerbased module used widely for
industrial applications.
to this application given its rugged
industrial build quality, a decent
array of inputs and outputs, and an
LCD screen.
The relay outputs control the solenoids simply by switching the 24V DC
power supply. Freewheeling diodes
such as 1N4004s can be used to protect against inductive voltage spikes,
although the relays are pretty beefy,
being rated at 265V AC/30V DC and
8A, so I didn’t bother.
The six digital inputs are wired to
22mm pushbuttons and switches for
user input. Digital Inputs 1, 2 and 3
are start buttons to begin a fill cycle.
siliconchip.com.au
Photo 1: the back of the Beer Can Filler, showing how the flexible tubes enter the
rear of the bulkhead fittings that lead to the pouring spouts. You can see the four
solenoids, plus the optional gas pressure regulator.
DI1 will fill the left can only, DI3 the
right can, while DI2 will fill both cans.
DI2 is also wired to a footswitch in our
application, as the operator usually
has their hands full with cans.
DI4 cycles through different timer
settings on the LCD. DI5 and DI6 are
used to adjust those timers up or down,
respectively.
Power is derived from a mains
switch-mode power supply rated at
24V DC 1.5A.
Software
The smart relay is programmed in
“ladder logic”, a graphical language
Australia's electronics magazine
widely used in industrial automation.
Inputs and outputs are linked to form
“rungs”, like in an electrical drawing.
Given its similarity to a schematic, it is
a popular language among practically-
minded people and a great way to get
into programming if text-based languages put you off.
The “code” is read from left to right.
Output elements called “coils” are
placed on the right side of a rung. The
coil will be energised if a connection is
established from the left side (a binary
“1”). Input elements called “contacts”
can be placed in line with the rung to
build up program logic. Series contacts
August 2024 71
Screen 1: the “Idle” state ladder
logic. Contacts M01 & M11 are
closed on program startup.
Should the user press a start
button, contact N01 (left fill),
N03 (right fill), or N02 (both
fill) closes, which latches M01/
M11 off and M02/M12 on. This
transitions the code to the
next state. Rungs 17-22 are the
“Purge” state code. Contacts
M02/M12 are closed when
transitioning from the Idle mode,
enabling Timer 01. When the
timer elapses (after five seconds,
user configurable), contact
T01 will close, which latches
M02/M12 off and M03/M13 on,
transitioning to the next mode.
Screen 2: the gas and beer
solenoid outputs. When in either
purge mode (M02/M06 & M12/
M16), relay outputs Q1 & Q2 are
closed, energising the solenoids
and begins the flow of gas. When
in beer fill mode (M04 & M14),
the same occurs for Q03 & Q04.
Screen 3: these rungs allow the
timer periods to be adjusted via
the buttons connected to inputs
I5 & I6 (N5 & N6). T05 is used so
that if you hold down one of the
buttons, the timer continuously
increments or decrements.
The “rung” numbers are
referring to the software.
72
Silicon Chip
Australia's electronics magazine
are a Boolean AND operation, while
parallel contacts are Boolean OR.
When the program starts, contacts
M01 and M11 are latched on. This is
the idle state, waiting for user input
to start the sequence. In the program,
the digital inputs are represented as
I01 through I06. If the user presses the
left start button, contact I01 is closed,
turning on coil N01 (rung 5).
M01 and N01 would then both be
closed, which latches M01 off and M02
on (rungs 12 & 13), beginning the fill
cycle – see Screen 1.
M02 is the purge mode, turning on
relay 1 (Q01 in the program) to begin
the flow of carbon dioxide (rung 65).
While in purge mode, timer T01 begins
counting (rung 17). Once the timer has
elapsed, purging is complete. Contact
T01 will close, which latches M02 off
and M03 on.
M03 is the pause mode, which turns
off the purge solenoid and waits for
timer T02 to elapse before latching
M04 and unlatching M03 to move to
the fill mode (rungs 26-27).
M04 turns on the beer-fill solenoid
Q3 (rung 69). Beer will begin to flow
from the keg into the can until timer
T03 has elapsed, which latches M04
off and M05 on to transition to the
second pause mode (rungs 32 & 33).
M05 is the second pause mode, waiting for timer T06 to elapse before latching M05 off and M06 on (rungs 38-40).
M06 is the final gas purge mode. Gas
solenoid Q01 is activated to provide
the final short blast of carbon dioxide
before the package is sealed (rung 66
on Screen 2). When timer T07 elapses,
M06 latches off, and M01 latches on,
at which point the program returns
to idle mode and waits for the user to
trigger the next can.
A similar process operates on
the right side using timers and
contacts M11/12/13/14/15/16 and
T11/12/13/14 etc. Minor differences
will exist between the flow rates into
each can, so different fill times can
be applied to the left and right sides.
The timers can be adjusted using I05
and I06 (digital inputs 5 and 6), which
increment or decrement counters C02,
C03, C04, C05 and C06 for purge time,
left fill time, right fill time, left post
purge, and right post purge, respectively (rungs 97-101) – see Screen 3.
Acceleration is provided via timers T04 and T05 (rungs 104-106) so
that the time will automatically increment or decrement if the button is
siliconchip.com.au
Fig.2: the platform and support
structure for the Beer Can Filler
were made from 19mm-thick
plastic, although the home
brewer could also use timber
(like MDF or plywood). The angle
bracket is for the beer cans to rest
on; the holes above that are for
the spouts.
held down. These counters/timers
are saved to non-volatile memory, so
settings will be preserved between
power downs.
The LCD screen will cycle through
individual pages for purge, break, fill
and post-purge as the sequence is executed. Timers are displayed to give
user feedback. When in idle mode, the
timers can be adjusted for purge, left
fill, right fill, left post purge, and right
post purge by cycling through the setting page using DI4 (rung 72).
I have saved the whole program in a
file called “Can_FillerV2.gen”, which
is available for download from the
Silicon Chip website (siliconchip.au/
Shop/6/414). You can upload that to
the PLC using the programming cable
specified in the parts list.
Mechanical construction
Begin by cutting out the plastic sheet
siliconchip.com.au
per the dimensions in Fig.2. We used
food-grade HDPE, as this device is
used in a commercial setting, but the
home brewer could substitute a plastic cutting board or timber. Glue and
screw the joints together using the drill
pattern. The aluminium angle piece
can be fastened in the same fashion.
Drill 13mm (or ½in) holes for the
pouring spouts on the front fascia.
This design has separate pipes for
the gas and beer. They were originally
combined using a tee piece to give a
single manifold to extend into the can,
but the pour is marginally smoother
with separate manifolds. Still, a single pipe is less cumbersome for the
operator.
See Figs.3 & 4 for the two hydraulic circuits, depending on whether
you use single- or double-outlet pipes.
Begin assembling the pipework by
fitting the pouring spouts through the
Australia's electronics magazine
Photo 2: the LCD screen shows the
current state of the process, including
the duration of any timer that is
currently in use.
August 2024 73
Fig.3: I built the unit shown here with separate outlets for CO2 gas and beer,
as I found it gave smoother pouring. However, it is a bit more fiddly to use
and requires extra pipes.
Fig.4: alternatively, use tee pieces to combine the beer and gas pipes into
single outlets. That means you only have to insert one pipe into each can
but I feel that it doesn’t do quite as good a job.
drilled holes using the bulkhead connectors. The pipe extends through the
solenoids and back to the main fitting: a
keg attachment for the beer & gas fitting
for the CO2. This design also includes
a local gas regulator, which gives more
consistent results as the canister runs
down, but isn’t strictly necessary.
The enclosure to house the electronics needs 22mm holes drilled for
the buttons and switches, as shown in
Fig.5. Also drill holes on the side of
the enclosure to fit the cable glands.
These are the penetrations for the wiring, so they can be positioned wherever is convenient. This design has
two on the bottom of the enclosure
and one on the side.
Now would also be a good time to
drill a small hole in the side to mount a
DC input socket and fasten it into that
hole. Drill 3mm holes in the centre of
the baseplate and thread 3mm fasteners and washer through to secure the
length of DIN rail. The smart relay and
screw terminals can now be clipped
onto the DIN rail.
Mount the selector switch and buttons to the front fascia by threading
through the 22mm holes, tightening
the plastic nut and clipping the carrier on the back. The enclosure can
be secured to the top of the assembly
using glue or some screws.
Electrical wiring
Fig.5: these five 22mm holes in the electronics enclosure lid are for the
controls: four momentary pushbuttons and one three-position selector
switch. Holes are also required on the side for cable glands to pass the
wiring through; refer to the vendor for the appropriate size and our photos
for their approximate locations. All dimensions are in millimetres.
The schematic/circuit diagram,
Fig.6, shows the required wiring.
Colour-code the wires red for +24V,
black for GND and white (or other
colours) for signals. Any cables with a
single termination should be crimped
with 0.75mm ferrules, while double
joins should be made with a double
ferrule. This isn’t strictly necessary
but does make for a neater job.
Begin by running a red wire from
+24V on the power supply input connector to each selector switch. Double
ferrules can be used to jump between
each switch. These switches wire to
the ‘normally open’ contacts on each
selector, which is the terminal pair
closest to the switch itself. A multimeter can be used to buzz out which
contacts are normally open and which
are normally closed if you are unsure.
White cable can then be used to
hook up each switch to its corresponding digital input on the smart relay.
DI1, DI2 & DI3 go to the three green
buttons at the bottom, while DI4 is for
the top button. DI5 and DI6 are for the
Australia's electronics magazine
siliconchip.com.au
74
Silicon Chip
Fig.6: connect the switches, solenoids and power supply as per this
diagram. The Remote HMI is optional and not described here, as you don’t need it. The foot switch is also optional.
Use the DIN rail terminals where you have to join multiple wires together, eg, for the common +24V & 0V connections.
Photos 3 & 4: while my unit has an internal power supply, you should build it with an external DC supply to ensure live
mains wires cannot coming in contact with anything else; that would be a major hazard. This can be done by drilling a
small hole in the side to mount a DC input socket and fasten it into that hole.
selector switch, which has two connections (up and down). If a footswitch
is to be used, it can be wired in parallel with the middle button (digital
input DI2).
The baseplate can now be placed
siliconchip.com.au
into the enclosure, but it is best not
to screw it in with the supplied self-
tappers until all the wiring is complete.
Continue with the red cable by connecting from +24V to one side of each
Australia's electronics magazine
relay output. The other side of each
relay runs to each of the four solenoids: Q1 for left gas, Q2 for right gas,
Q3 for left beer and Q4 for right beer.
Complete the solenoid connections
by running a black GND wire to each.
August 2024 75
Photo 5: make
the wiring to
the front panel
switches long
enough that
you can swing
it out like this.
These industrial
switches are
waterproof
and making
connections to
them is easy
thanks to the
screw terminals.
Photo 6: a
closeup of the
pipework on the
rear of the unit.
The solenoids
I used for beer
(below) are larger
than the ones for
gas (above) but
you can use four
of the same type.
Just make sure
the beer valves
have orifices at
least 4mm in
diameter to avoid
the beer fizzing
up as it passes
through.
76
Silicon Chip
Australia's electronics magazine
The DIN rail screw terminals can
be fitted with internal jumpers and
used as a busbar for multiple GND
connections, including for the DC
input socket.
Programming and testing
Plug in the power supply and switch
it on. You should see the LCD on the
smart relay glow green and boot up
into a menu.
Download the smart relay software
(SG2 Client) from https://oceancontrols.
com.au/TEC-005.html, install it and
run it. Download the source code (from
siliconchip.au/Shop/6/414), unzip it
and open it using the software.
Plug the programming cable into
your computer via the USB to RS-232
adaptor. Give Windows a few minutes
to install drivers, at which point the
programming cable will appear as a
virtual serial port. You can check progress using Windows Device Manager,
which will display the serial port as a
COM port under Ports (COM & LPT).
The other end of the programming
cable can now be plugged into the
smart relay. A small cover below the
keypad obscures the programming
port, but it can be removed with a flatblade screwdriver. This will expose a
four-way header, which accepts the
other end of the programming cable.
Back in the software, a connection
to the smart relay can be established
via Operation → Link Com Port. Enter
the COM port name as shown in Device
Manager. You should get a “link successful” dialog box after pressing OK.
The source code can now be uploaded
to the smart relay using the “write”
button on the toolbar. Once the progress bar is complete, the smart relay
should be ready.
Briefly power cycle the relay after
programming to place it into run mode,
or that can be manually selected using
the keypad buttons and LCD. Once
the program is running, you will see
a screen similar to Photo 2 on your
LCD. You can now test the sequence by
pressing one of the run buttons (DI1 for
left, DI2 for both or DI3 for right). The
solenoids should click on in sequence.
The run timers can be adjusted by
cycling through the menu using the top
button and changing parameters using
the selector switch. Finish the build
by removing the programming cable
and securing the lid to the enclosure
using the provided fasteners.
Happy brewing!
SC
siliconchip.com.au
Parts List – Beer Can Filler
1 TECO SG2-12HR-D programmable logic relay [Ocean Controls TEC-005]
1 TECO SG2 series PL01 programming cable [Ocean Controls TEC-200]
1 TECO OP10N 4.3in 192 × 64 pixel graphic panel (optional)
[Ocean Controls TEI-001]
3 green momentary pushbuttons [Ocean Controls HNR-200G]
1 white momentary pushbutton [Ocean Controls HNR-200W]
1 3-position momentary selector switch [Ocean Controls HNR-232]
1 24V DC 1.5A+ external power supply [Altronics M9393B]
1 175 × 35 × 7.5mm top hat DIN rail strip [Altronics HA8572]
5 25A 2.5mm DIN rail screw terminals [Altronics P2400]
1 shorting link for 25A 2.5mm DIN rail terminals [Altronics P2460]
1 220 × 160 × 80mm IP65 sealed ABS enclosure [Altronics H0333]
1 aluminium baseplate to suit Altronics H0333 [Altronics HA0312A]
1 USB to RS-232 converter [Altronics D2340B]
1 chassis mount DC barrel socket (to suit power supply) [Altronics P0622]
Cable & hardware
1 370 × 300 × 19mm plastic or timber sheet
(for example Delrin, HDPE, MDF, plywood)
1 320 × 300 × 19mm plastic or timber sheet
(for example Delrin, HDPE, MDF, plywood)
1 300 × 100 × 19mm plastic or timber sheet
(for example Delrin, HDPE, MDF, plywood)
1 300mm length of 50 × 50 × 1.6mm aluminium angle
25 M3 × 10mm panhead machine screws, nuts and flat washers
3 cable glands to suit 5-10mm cable [Altronics H4315A]
1 7.5A mains cable terminated with bare wires
(not required if using an external 24V supply) [Altronics P8400C]
1 5m length of red heavy-duty hookup wire [Altronics W2270]
1 5m length of white heavy-duty hookup wire [Altronics W2271]
1 5m length of black heavy-duty hookup wire [Altronics W2272]
1 pack of 0.75mm single ferrule terminals (optional) [Altronics H2425B]
1 pack of 0.75mm double ferrule terminals (optional) [Altronics H2488B]
1 ferrule crimp tool (optional) [Altronics T1547A]
Gas/liquid handling
1 beer keg
1 keg coupler [KegLand KL06903]
1 carbon dioxide (CO2) tank
1 gas fitting to suit the CO2 tank
1 adjustable gas pressure regulator (optional) [KegLand KL15035] ◾
1 12m length of food-grade 8mm OD flexible gas-tight tubing
[KegLand KL06224]
4 24V DC normally-closed solenoid valves, 2 × ½in BSP male threads 🔷
[AliExpress 1005005244510404]
8 ½-inch female BSP to 8mm push-fit adaptors [KegLand KL18753]
1 8mm diameter, 200mm long & 1mm thick stainless steel tube (304 grade)
2 8mm push-fit tees [KegLand KL02387]
4-5 8mm push-fit elbows [KegLand KL02400] 🔴
4 8mm push-fit bulkhead fittings [KegLand KL21036]
1 small roll of gas-tight (blue) Teflon tape
AliExpress 32926145983 is a cheaper alternative, but you will also need
one ¼in male BSP to 8mm push-fit adaptor plus one ¼in female BSP to
8mm push-fit adaptor
these are not food grade but we think they are suitable for home use if
cleaned. We used (much more expensive) food-grade alternatives in our
unit; see www.valvesonline.com.au/stainless-steel-general-purposedirect-acting-norm (4-inch male BSP adaptors are required instead of
½-inch female)
one extra elbow can result in neater hose routing but is not strictly required
Silicon Chip
PDFs on USB
¯ A treasure trove of
Silicon Chip magazines on a
32GB custom-made USB.
¯ Each USB is filled with
a set of issues as PDFs –
fully searchable and with
a separate index – you just
need a PDF viewer.
¯ Ordering the USB also
provides you with download
access for the relevant
PDFs, once your order has
been processed
¯ 10% off your order (not
including postage cost) if
you are currently subscribed
to the magazine.
¯ Receive an extra
discount If you already
own digital copies of the
magazine (in the block you
are ordering).
EACH BLOCK OF ISSUES COSTS $100
NOVEMBER 1987 – DECEMBER 1994
JANUARY 1995 – DECEMBER 1999
◾
JANUARY 2000 – DECEMBER 2004
🔷
JANUARY 2010 – DECEMBER 2014
🔴
siliconchip.com.au
Australia's electronics magazine
JANUARY 2005 – DECEMBER 2009
JANUARY 2015 – DECEMBER 2019
OR PAY $500 FOR ALL SIX (+ POST)
WWW.SILICONCHIP.COM.
AU/SHOP/DIGITAL_PDFS
August 2024 77
|