Stokes’ ProjBlog

A journal documenting innumerable, mostly terminally in-progress undertakings. Nerdiness abounds.


‘The Soda Machine Hack Project’ September 4, 2009

Filed under: New project!,The Soda Machine Hack Project — Stokes @ 5:19 pm
Schematic of W&B's vintage beverage dispenser.

Willoughby & Baltic has acquired a vintage soda machine; if I were to guess, it dates back to the late 1950s or early 1960s. It’s a massive steel box with a wood veneer front, its sides an industrial non-color. In contrast to more modern machines, its only text is the words Cold Drink in small, white-on-black, sans-serif lettering above a narrow, horizontal window displaying a representative can of each beverage within. I should have thought to photograph it, but I was distracted by the interior. Inside, the machine is a wonder of space-age technology: as you can see from the schematic, everything operates on 110V AC line current, and its works are almost entirely electromechanical relays and solenoids. Frankly, it’s pretty cool.

Of course, the first thing that needs to be done to the machine is connect it to the Internet. Why? I don’t know. I’m only interested in the ‘how’ at the moment.

Optocoupler interface for detecting selections.

The first step of that first step is building microcontroller-compatible interfaces for the machine’s 110VAC inner workings. Since most microcontrollers operate on DC between 3 and 5 volts, this will take some doing.

There are two basic functions that need to be exposed; the first is detecting the beverage selection. For this, I’ve built a board (here’s the schematic) that uses optocouplers to pass the signal but keep the two voltages electrically isolated. It’s really pretty simple. Every button is a SPDT switch, wired so that the first button pressed cuts the power to all the rest; only one button can be active at a time. The output from each of the seven buttons is split; one side goes where it was intended, the other to the board’s inputs. When a button is pressed, one of the seven low-voltage outputs on the other side of the board goes ‘high’ (i.e. changing from ground to just below +5VDC). The signal will come through as a rapid series of pulses (half of the AC sine wave), but I’ll account for this in the software.

Simple 12V relay board.

The other thing that a computer-enabled soda machine must be able to do is operate cashlessly. We use uniquely-identifiable iButton keys for other purposes at W&B, so I plan on using those to allow members to put a drink on their tab. Looking at the machine’s schematic, it appears that the coin box abstracts the credits put into it; it just closes one of four circuits when ‘enough’ money has been put in. The four separate circuits apparently allow for four separate prices, although the W&B machine has everything cost the same. The board I put together for this (schematic) is a fairly generic relay controller. When powered, the relay switches the credit circuit’s source away from the coin box. This circuit uses an optocoupler in a way opposite of the first board; it sends a signal from the low-voltage portion. There’s actually an extra step in this: the relay is what connects to the machine’s native 110VAC, and it operates on 12VDC. The optocoupler controls that 12V signal which in turn controls the 110VAC.

The selection detection board is fairly straight forward to hook up; all the buttons are connected with standard ‘spade’ connectors, all of which are accessible when the machine is open, so putting in a splitter is just a matter of plugging it in. The credit faker’s attachment is not so obvious. The coin box is a separate module, connected via a strange plug that looks like four standard grounded plugs stacked vertically. I’m going to have to open up what the schematic refers to as the control box, which is literally an ominously featureless steel box located next to the coin module. While I’ve tried to plan all my modifications to avoid making permanent changes to the machine, this will almost certainly need some ‘higher impact’ hacking.

If I don’t get a job in the meantime, I hope to do some additional work next week. I should really take some photos of the machine itself as well.

Stokes’ Project Blog


Leave a Reply

You must be logged in to post a comment.