Recently, we have expanded and upgraded the brewery for larger batches and more effecient brewing. More equipment, requires additional controls. Initially, we were looking at building a traditional controller, using PID`s and switches. This would allow us to control the pumps and heaters. This is the most traditional method for brewery controllers, and there are a lot of clever guides on how to build this, both High-End and low budget versions.

But with some creativity and skills, this can be done using a mixture of software and hardware. Just recently, i came across an application that can achieve just this: CraftBeerPi Find the guide on installation on the official GitHub page. But we will get you through the process here as well. So, what do you need? Well, lets start with what we have done, and let that be a guide.

Also, see our Automated Fermenter for controlling a refrigerator automatically.

This guide will cover;

Parts and tools

Software setup  Hardware Connecting it all 

*skip to any step by clicking them

Parts and tools

1x Raspberry Pi. What model you use is not important as from the model B, they all work for this type of application. One thing to note, is that the older versions have less processor speed (700MHz) and less memory (512MB) than the newer ones. These are models A+, B, B+. From RPi version 2, we have more processing speed with quad core (900MHz) and double the memory with (1GB). What does this mean for you? Its a bit faster, you can run other processes on the RPi and more flexibility. That being said, you can also use the Raspberry Pi Zero, for a minimal build. But we recommend running Raspbian Jessie with your install, and recommend the model 2 or 3 of RPi.

1-3 DS18B20 Temperature Sensors

Stainless Steel Thermowell This is the best way to get your temperature sensor inside the kettle. These come with o-rings to keep a watertight seal and is rated for this type of application. See our guide on how to build your own DS18B20 RTD Thermowell with quick connector.

We do however recommend you buy DS18B20 Kits that are pre-built. There is little cost to save in building your own and you have the potential to get poor readings if not done correctly.

1x 4,7k Ohm ResistorThis will jumper between your sensor pin (GPIO4) and your voltage pin.(5V)

1-4 SSRs (3-32VDC control) Keep in mind that you need one that is rated for what your connecting to it. A powerful heating element will draw maybe 16+ Ampere. The common ones are 40A and 25A versions. We also recommend getting a heat sink on the SSRs as this will prevent it getting hot during operations with e.g. heating elements. Please check around before purchasing SSR`s. There are a couple on the marked that simply wont work with the normal GPIO voltage. The GPIO voltage is just slightly over 3V and some SSR`s require 3.5v and more to function. We have used  MAGER and FOTEK SSR`s. But there are plenty of good options.

GPIO jumper cables. This enables us to jumper from the Raspberry Pi board to our SSR`s etc..

While you dont need a screen for your setup and can access the software using any PC, cellphone etc.. Some want to have a screen attached to the controller. In that case, we recommend using the official RPi touch screen. This is easy to connect and easy to mount in a panel. It runs of the Raspberry Pi`s 5V power, so it doesnt “steal” any connectors we would otherwise need.

We are going to leave the power sockets out of this list. This is best sources from your local hardware store. Just make sure it is rated for the output you plan to put on it. A 16A socket is not rated to handle a 5500W element. Recommend getting some industrial grade sockets and connectors for the elements. For pumps and auxiliary equipment, there are some very good  Neutrik PowerCon connectors. This is a great connector making connecting your equipment very effortless, but they only go up to 20A, So thats something to be aware of.

For our build, with the screen, it came to around 3500NOK or just over 300EUR. Thats not bad for a brewery controller. And you also have the option of upgrading this setup if your brewery expands.

SOFTWARE

Raspberry Pi 2 B+

We recommend using the Raspberry Pi 2 model B and above. This has a decent specs to run applications smoothly. The application doesnt require much, and we have tried running CraftBeerPi on older Raspberry Pi`s, but its sluggish and things take more time. You should go for a 16GB Micro-SD card and have a power supply that can deliver at least 2.5A.

SD CARD Preperation:

First, make sure your SD card is formatted. The easy method of doing this is from Windows startmenu, search for: diskpart This will give you a small cmd window where we can manually clean and format our SD card. Why not the old fashion way? Because SD cards that have been used before are really difficult to format to their full size using the traditional Windows format option. Why? -i have no idea.. 🙂

From the cmd line, type;

 list disk

You will now see the available disks on your system.

#Disk ###  Status         Size     Free     Dyn  Gpt

#  ——–  ————-  ——-  ——-  —  —

#  Disk 0    Online          931 GB  5120 KB        *

#  Disk 1    Online           28 GB  3072 KB

Find the one matching your SD card. In this case, its Disk 1. So we need to select it by typing;

 select disk 1

# Disk 1 is now the selected disk.

To whipe everything on the SD card, type;

 clean

# DiskPart succeeded in cleaning the disk.

We are now left with a completely wiped SD card. To make use of our available space, we need to make a partition;

 create partition primary

# DiskPart succeeded in creating the specified partition.

And finally, we format the new partition;

 format quick

#   100 percent completed

# DiskPart successfully formatted the volume.

 exit

Installing Raspberry Pi operating system (Raspbian Jessie)

Download ISO: https://www.raspberrypi.org/downloads/raspbian/ If your SD has sufficient space, and you are running a Raspberry Pi 3, choose full version (with PIXEL). When downloaded, extract the zipfile to find your rasbian iso file.

(On Windows) Install Win32 DiskImager: https://sourceforge.net/projects/win32diskimager/ Select the ISO from the folder you just unzipped and click «WRITE»

Once this is complete (approximately after a small glass of beer) you will be presented with the succession message. Remove your SD card, install in your Raspberry Pi and power it up.

 (note: Raspbian Jessie doesnt have SSH enabled by default. So you wont be able to access your Pi remotely. The first time you boot up make sure you are connected to a monitor and have a keyboard available. There are a few steps needed to be made before your Pi is accessible anywhere on your network)

When you boot it up on the version with PIXEL, you will be presented with a dashboard. You need to get to your MENU – ACCESSORIES – TERMINAL. Inside the terminal you type;

 sudo raspi-config

If you are running Jessie Lite version, you will boot directly to command line and you will need to login using the default username: pi / password: raspberry

Here you will need to do a few things, and maybe a few optionals as well.

You NEED to go; 7 Advanced OptionsA1 Expand Filesystem

Remember the SSH being disabled, you need to go; 5 Interfacing OptionsP2 SSH and enable SSH access. If you are using shields or PiFace as your interface (if you dont know what this is, you are probably not using this:) you should enable from 5 Interfacing Options  the P4 SPI module.

We also recommend that you change your password for the pi user. To to this, go; 1 Change User Password and make your own unique password. This is because we are both opening the Raspberry Pi`s SSH access and we are running it on our network for long periods at the time.

These are all the necessarry steps, you can also do; 2 Hostname – and change your hostname to example craftbeerpi or brewcontroller or etc.. and change your Locale options (timezones and languages)

Make sure you click finish and YES to Reboot your Pi.

Technically you can now just plug your pi wherever you want and make sure its connected to the internet via ethernet cable. (we cover the WIFI setup further down) You dont need a screen or keyboard for the rest of this tutorial as we are just connecting to it via SSH ?

SSH

(On Windows) use a software called «Putty» to access your devices. You can get that here: http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

When you fist start putty, you are asked to enter your device`s IP and port. Finding your devices IP can be done through a network scanner phone app, e.g. «Fing» Once you scan your network and find your raspberry pi`s IP, enter this in putty with the default port of 22. Your computer will now tell you that: «The Servers host key is not cached in the registry» Thats a standard message letting you know that you are opening a connecting with another device not before accessed. Click yes to continue.

When asked for a username, enter pi

When asked for password, enter the password you changed in the above steps. If you didnt change it, its raspberry

First things first. Ensure the raspberry pi is updated with all the latest software updates. Even though we just downladed the OS online, there are updates that have been released since it was put there.

 sudo apt-get update && sudo apt-get upgrade

If you are on an older raspberry pi and it finds a few new updates, get yourself a beer, your in for a little wait ?

WIFI

If you are on a raspberry pi 3 or you are using a wifi dongle, you need to set up your pi to connect to it. We need to enter our wifi network details in the configuration file. From the terminal, we go;

 sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Go to the bottom of that file and add (paste) this in it;

 network={

ssid=”your-network-ssid”

psk=”Your_wifi_password”

}

When you edit files using «nano» you need to hold ctrl and o to save your changes. Hold ctrl and x to exit. If you have issues with how to paste text into the terminal, this is done with «right click» on the mouse.

You can test that you are connected to your network by typing; ifconfig wlan0 If you can see an address beside the line inet addr you are connected!

Your Raspberry Pi can now run by only connecting it to power and nothing else. Sweet!

Before unplugging the ethernet cable, exit the SSH connection in Putty by typing; exit

When you boot on your wifi network, you will most likely end up with a new IP address. So repeat the steps above to find your IP again, enter this into in Putty and answer YES to the «Servers host key is not cached..» message.

Booting into your brewery controller

If you want to boot the Raspberry Pi straight into a fullscreen CraftBeerPi, and you are using the Raspberry Pi`s HDMI or the official 7in touch screen, then you need to configure your boot configuration.

Install Chromium:using the command; sudo apt-get install chromium-browser If that doesnt work, please follow this guide

To configure chromium to auto start in fullscreen mode, edit the autostart file with this command;

 sudo nano ~/.config/lxsession/LXDE-pi/autostart

And edit the file so it looks like this:

#@lxpanel –profile LXDE

#@pcmanfm –desktop –profile LXDE

@point-rpi

@xset s off

@xset -dpms

@xset s noblank

@chromium-browser –-noerrdialogs –-kiosk http://localhost:5000 –incognito 

When you reboot, you are booting straight into the CraftBeerPi application in full screen. If you at some point want to revert back and boot into your desktop, just edit this file and put a # before the lines we just added and remove the # from the first two lines.

If you want to hide the mouse cursor when your not using it, you can add a command to remove it. First you need to install «Unclutter» by running:

 sudo apt-get install unclutter

In the same config as above, you add the command;

@unclutter -idle 0.1 -root 

This removes cursor when its not in use for more than one second, it will be visible again as long as you move it.

CraftBeerPi

Now we can move on to setup your CraftBeerPi.

git clone https://github.com/Manuel83craftbeerpi.git
cd craftbeerpi
sudo ./install.sh

  • Updating CraftBeerPi is just as easy, just navigate to the folder and run the command git pull

 

 

HARDWARE

SSR (SOLID STATE RELAY)

What actually makes things turn on and off is the SSR (Solid State Relay) You need to make sure its 3-32VDC Controlled and preferably of a good quality. Example:

25A AC Solid State Relay SSR with Heatsink

The Raspberry pi will control this using its GPIO pins (see those pins on the picture above) When the SSR says DC 3-32V Control, it means that the small voltage the GPIO pins can apply, will be able to control the SSR (on/off). You need one SSR for each function you want to make. Pump, Heater etc.. some can also use smaller SSR`s, but you need to make sure it can handle the current draw. (e.g. 5500W heater on 230V will get you just over 24 Ampere) Make sure you calculate your own brewery consumption. A good tool to do a rough calculation can be found here

The basics of an SSR is quite simple. Some form of signal is used to close or open a circuit. (that is the very very simple concept) For the purpose of using a Raspberry Pi to control the SSR, we use a 3-32VDC control SSR. Using the SSR with a Raspberry Pi is quit easy since the Raspberry Pi`s GPIO pins will send out a 3.3V signal, enough to control the SSR. So, think of your GPIO pin and wire as your positive, and then connect the other to Ground. When you activate one of the pins via your CraftBeerPi software, it will connect the two points and complete the circuit.

For the connecting to hardware, all we need is to take your example L wire from your power input and connect it to one of your SSR terminals. The other terminal will have a similar L wire to your hardware. The N wire will go straight from power to the hardware. And thats how we make the software control the hardware.

One thing to remember is that there are also some very poor SSRs out there. These will “claim” to be 3-32VDC controllable, but in fact, you need close to 5V to be able to open/close the SSR. And some are just poor in build quality. Use what other people are using and recommending, thats the best advice.

Speaking of what type to recommend; Mager SSR and Fotek SSR.

What about Ampere? Yes, well.. its down to what you connect to them. 5500W or more heating elements will quickly reach the limit of a 25A SSR. Remember, when open, it will generate a lot of heat and if you need to run your element full force, it puts quite the load on your SSR. We like to think of it this way, 25A will be more than sufficient for your pumps and other accessories. 40A will cover most heating elements. But please, do check and do some calculations before installing your own. We do however recommend a heatsink on your SSR. And while heatsinks often come with the SSR, we recommend putting some thermal paste underneath for the best heat transfer.

The heatsinks above (and most of the ones that come with SSRs) will fit directly onto a DIN rail. Otherwise, you can easily mount them with screws inside your controller box. Please remember to keep a plastic cover on them, or lock the controller when in use, as you will have an exposed connection here.

Below are two 40A Fotek SSRs being mounted in our controller on a DIN rail.

On the 3-32VDC control terminals, we can share the Ground between them, leaving less wires clogging up your box. If you go for the same IKEA box we have, you are insulated quite well in terms of electrical shock from equipment failures. If you do have a metal cabinet, please remember to ensure a solid ground connection to your DIN rails and other parts e.g. door and the cabinet itself. And one important thing to note, we are not electricians, we should always consult with competent people before putting power on equipment like this.

Temperature Sensor (DS18B20)

For the sensor, use a DS18B20. This works great with Raspberry Pi`s and will work in series. Note that recent experience recommends connecting the standard 3.3V and GPIO4 as normal with a pull-up resistor between, but run the 5V directly to the sensor. This is for better quality signal and better readings.

Now you have to make it work inside your kettle. If you want to get a proper solution for connecting the sensor to all this hardware, have a look at the RTDconnector kit. This could allow you to solder your sensor to a mini xlr connector, and it can now be disconnected if your moving the kettle for cleaning etc. For the other end of the temp sensor, just use ordinary XLR/mini XLR plugs and sockets;

6Pcs XLR 3 Pin Panel Mount Male Chassis Socket Connector +

3Pin Female XLR Connector For Microphone Mic Cable Cord plug Connector

*Update* If you want to build this into a thermowell for your kettle, see our thermowell guide here

Connecting it all up

(please be careful when connecting power cables!)

 

 

 

From our setup in the above image, we can now configure our hardware in CraftBeerPi. Example; Additional Hardware – Type: Pump – Connector: GPIO18. The pump will now switch on/off using the application.

lmbcontrol

And there it is, A low cost brewery controller. Expandable to HERMS by just adding more SSR`s and temp sensors.

The community and the creator of CraftBeerPi is constantly working on pushing new and improved features to the application! Visit www.facebook.com/craftbeerpi to follow.

If you want the “Raspberry Pi with tap handle” logo, You can download the image here.

 

Leave a Reply