Student hacks Raspberry Pi to run college bar

A student at the University of Oxford has modified a
Raspberry Pi to alleviate the workload at his college bar.
Johan Paulsson, who's studying for a PhD in theoretical physics at
Wolfson College, was dissatisfied with the performance of the bar.
Students weren't getting their beers as fast or as efficiently as
possible -- a tragedy for any "beer manager", Paulsson's official
title. "The bar is student run, which means basically it's kind of
amateur alley," he explained to Wired.co.uk, "No one really knows
what's going on. Me being Swedish, I thought that was completely
and utterly inappropriate."

After months of coding, Paulsson successfully
redesigned the day-to-day operations of the bar, creating an
efficient and speedy service. "When I started no one had any idea
what was being sold or at what quantity. I didn't like that at all.
So what I started doing was itemising the till, with the intention
of exporting the data from the till into a database -- I have now
made this completely automated thanks to the Pi."

Specifically, the Raspberry Pi can fetch sales data at 30-minute intervals
directly from the bar, which is stored as a MySQL database and used
with plotting tools for data analysis. Parse emails can then be
received from suppliers after stock deliveries to cross-reference
them with till sales, which can effectively warn staff of stock
shortages, as well as update till prices when suppliers change
theirs.

There's also a light sensor, "So when the lights
of the bar are turned on, the sensor detects the lux rates, which
updates the website," saving students from a potentially needless
five minute walk through the quads, to the bar and back again.
Paulsson is looking into acquiring more sensors, "I really want to
put in a temperature sensor in the back room, so you can have a
health and safety idea of what's going on. These things are
surprisingly accurate." The system can also automatically create
up-to-date menus using LaTeX, a document preparation system and
markup language, which has been installed on the Pi.

After months of coding, Paulsson successfully redesigned the day to day operations of the bar, creating an efficient and speedy service

Phill Brown

After investing in a Sonos sound system, which
has its own API, Paulsson connected it to the same network as the
Pi, which he then programmed to monitor volume levels and adjust
settings using python scripts, depending on the time of day and the
type of club, society or event using the bar. A separate amplifier
is on the same network, controlling settings for another room,
hosting a surround sound system, big screen, and Playstation 3. The
amplifier is also controlled through python scripts, ensuring that
it is reset to the default settings every night, should some of the
users forget. "I'm also working on creating a playlist saved by the
Pi, so if someone was at the bar and heard a great song, they could
check the website later that evening or the following morning and
find out exactly what song it was."

Finally, when the bar's student rota manager
quit without training a replacement, Paulsson moved all of his
responsibilities to the Pi. "There's a database of all the people
that have volunteered, so at the start of a new term the Pi sends
out an email requesting volunteers to take a shift, providing them
with a deadline to comply. After a week, it looks at everyone who
hasn't picked a shift and begins assigning them to empty slots
automatically. The Pi also sends reminders when shifts are
imminent. It has really become a one-stop shop for everything we
need now."

Remarkably, the Pi is completely capable of
pulling the pints as well as handling databases and till
management, but Paulsson daren't go that far, "The Pi doesn't do
any form of the dispensing at all. Although that is possible, it
would run afoul of British law, since you need a 'responsible
person' behind the bar and I don't think a computer counts, even
though it would technically meet all of the legal
requirements."

Paulsson highlights other elements of the Pi
setup that could veer into moral grey areas "We could see which
user in college is down in the bar most often, but I don't think
they would be particularly happy to be called out on
that."

Despite opportunities to turn this system into a
profit-making business, Paulsson has no interest for now. "It has
been suggested to me, so I gave it a little bit of thought. It's
just this is more of a hobby that happens to be very useful. I
could monetise this, I could, I very much could. But I'm not really
interested. At the most I might clean it up and open source it. But
really I just do it for the love it."