Intro: Brewing Beer with Erlang, Bootstrap, and a Raspberry Pi
I've started working on a homebrewing controller and interface for the
learning how to program things that interact with the real
learn more about the processes involved in brewing beer
manage my homebrewing accurately as to easily measure and reproduce
any changes I make between brews
brew good beer consistently and with minimal effort - this is the
most important bit right? :D sure is!
I started off with an Arduino,
but have now moved to Raspberry Pi
and Bootstrap. The Erlang
side has stayed the same other than the Raspberry Pi related libraries :D
defined with Protocol Buffers for easily understandable configuration
looks a bit like this where I define what each point does and its neighbours:
This allows me to:
Attribute actions and processes to specific vessels, pumps,
intersections, valves, and pipes.
Use the point graph to tell when a route includes a pump leading
to it being automatically turned on when necessary.
Draw a diagram of the kit on the screen labeling each point.
Track changes in my kit, processes, and recipes via git
repositories. Fork this kit/process/recipe!
The backend is written in Erlang and I can do things like this:
Show me! show meeee!
It looks like this! My old interface ended up being horrible, and this
new Bootstrap based one is awesomely lovely.
The Power indicators show the state of the sockets that are either
on, or should be on and are currently off. In this case both 1 and 2
are on. Socket 0 is not on and is not supposed to be on, otherwise it
would be visable and red.
The Temperature indictors show the current states of each thermistor.
They will eventually show the rate and direction of change as well as
target temperatures e.g. for efficient boils and mash temperatures
The list to the left is a step-by-step list of each process involved,
and other ingredients (and even cleaning solution!) in the system.
Migrating from the Arduino
The Hardware side of things
This is the Arduino I was previously using (^above).
And this is the new Raspberry Pi along with a lot more neat wiring
than before, since now I have the experience to know
exactly what I’m doing.
The Software side of things
The code I had on the Arduino simply routed data directly down the
serial port to the Erlang code, so was super easy to migrate to
Raspberry Pi, well… sortof. I had to write:
pie Erlang bindings to [pihwm] Raspberry Pi C interface
pt2262.erl Erlang code to produce pt2262 encoded signal sequences where previously I used the
Arduino code made available by rayshobby.net
Well that’s the intro. Hopefully I’ll show it all working and release
some more code soon. I haven’t even brewed with it yet! Been too busy
and enthused getting it all connected and designing the whole thing.
It’s great fun! I feel like a beer now but need to get to bed ready to brew
more beer at work tomorrow morning :) Bottoms up!