Beer PID

Note: to the benefit of my mostly German-speaking readers I have translated all the brewing-related words to German (de: …)

Let’s brew us some beer!

I ordered some home brewing equipment from Hopfen und mehr (German only, sorry) a few weeks ago.

A lot of discussion goes on about how exact the temperatures of the enzymatic rests (de: enzymatische Rasten) during mash need to be. I didn’t want to take chances and so I build my own PID-controller. Originally I wanted to use an osPID but my osPID is still in transit from Malaysia (I hope) so I grew impatient and built one myself with an Arduino.


I had achieved some good results in the past with the OneWire temperature sensor DS18S20 so it was a natural choice. These transistor-sized devices are incredibly easy to use via their OneWire interface. As a bonus OneWire is a bus so you can connect several sensors to the same pin! On top of that there are two handy Arduino libraries ready to use in your own project one for OneWire in general and one for the temperature sensor.

For practical use I put the DS18S20 into an aluminium tube and crimped it shut with a pair of pliers. This went surprisingly well. It stayed dry or at least dry enough so that it kept working immersed in mash (de: Maische) and later wort (de: Würze) for hours. This is an advantage of the DS18S20 I forgot to mention: Preliminary tests showed that it works correctly or not at all. No false measurements.

Solid State Relais

Somehow you have to switch the heating coil of the mash tun (de: Würzepfanne) so I decided on a solid-state relais. These live very long, switch their load when the current is zero and only need a pull-up resistor on the driving side. I chose a Carlo Cavazzi RM1A23D25 but you can use any SSR that fits, you should use a zero current switching one though. Also make sure you fix it onto something that takes away the heat the SSR generates. In my case I drive a WECK WAT 24 A which consumes 1800W electrical power. I bolted the SSR onto the bottom plate of the aluminium case with some thermal grease in between. Though the SSR had to switch this amount of load the case only got slightly warm.

On the back side I added a mains socket which happened to be available. This way the switched device can simply be plugged in:

Front panel

To display the temperature I use the 7-segment display with serial interface that you can get from Sparkfun. (Note to German readers: You can order most of what sparkfun sells from Watterott at reasonable prices). I would have liked to use an alphanumberic LCD display. But that is beyond of what I can easily fit into a useful housing without ruining my hands, tools or the housing. Hardware vendors listen: We need more easy-to-use cases for our self-made electronics!

Add a three switches, and two LEDs and the hardware side is basically done.


The Software depends basically on two main parts both by Brett Beauregard, the Arduino PID Library and the Arduino PID Autotune Library. Unfortunately I have not managed to tune the PID good enough to really use it without manual intervention. I need to investigate more about that. But nevertheless the BeerPID is programmed to hold 7 different built-in temperatures. This page (in German) has a good overview over all (?) the enzymatic rest temperatures. I chose to implement those temperatures:
0 – (36° C) Glucanase rest
1 – (44° C) Xylanase rest
2 – (50° C) Saccharase rest
3 – (57° C) Protease rest
4 – (62° C) Maltose rest
5 – (72° C) alpha-Amylase rest
6 – (78° C) Mash out (de: Abmaischen)
7 – (105° C) boil
The boil temperature (105° C) is chosen simply to enforce permanent on-state on the SSR. Of course the mash tuns content it will never reach 105°.
Please have a look yourself and send me your pull requests.

Update: several people have mentioned BrewPI on twitter. Give me a couple of days to look into it, Thanks

6 Gedanken zu „Beer PID“

  1. Basteleien (vor allem welche mit Microcontrollern) sind toll! Basteleien mit 230V eher weniger…
    Wenn sich so hohe Spannung trotzdem nicht vermeiden lassen, wenigstens daran denken: Ist das Gehäuse geerdet? Und wenn ja, ist es ausreichend gut geerdet (verschraubt; im Besten Fall mit einer “Einzelheit Z”), so dass sich die Erdung nicht zufällig, oder durch Hitzeentwicklung lösen kann?
    Grüße von einem Elektroniker, der beim Anblick der Verdrahtung so seine Bedenken hat…

    1. Ich sehe schon, ich muss noch ein paar Bilder posten. Aber sei beruhigt, das Gehäuse ist natürlich ordentlich geerdet. Ich bin ja nicht lebensmüde!

  2. Kleine Anfrage an den Rechnungshof: Was kommt denn der ganze Spaß so? Also, würde mich interessieren, was grob an einmaligen Kosten für unbedingt nötiges (Kochtopf usw.), schick zu haben (Arduino etc.) sowie laufenden Kosten für Verbrauchsmaterialien (Maischemix usw.) pro Produktionszyklus anfallen.

    Besten Dank,

    1. Schau doch mal bei was das Starterset für Maischebrauer “Premium” und die Malzmischungen kosten. Dazu kommt dann noch ein bisschen Abfüllequiment. Ich würde sagen, die meisten Applegeräte sind teurer.
      Beim BeerPID ist das schwierigst zu bekommende Bauteil das Solid-State-Relais. Insgesamt würde ich so mit 70-80€ rechnen.
      Wichtig ist, wie von Andreas im CRE gesagt die Lösung für’s Läutern. Wenn das nicht ordentlich klappt hat man Trauer. Das MattMill Läuterblech funktioniert super.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.