• Web Interface with Cherrypy

    Krockwell03/29/2020 at 23:06 0 comments

    Cherrypy is a really neat python web framework that I am using to provide the user a way to interact with the fermentation station. From a central website, the user can set a static temperature set point, much like a typical off-the-shelf temperature controller. The fermenter will maintain this temperature indefinitely until the user sets a new set point. Alternatively, the user can upload a file to the server which contains multiple set points with corresponding time durations.

    Here are some screenshots of the very early-stages of this website.

    Here is the mainpage, it will display the current temperature and setpoint. There are two links that send the user to pages where they can set either static or dynamic temperature set points.

    Here is the static temperature set point page. The user can enter any desired set point.

    Here is the dynamic temperature set point page. The user can upload a file detailing a temperature profile.

    Next Steps:

    1. Integrate the cherrypy test code with the existing fermenter control code. I'd like to be able to use this website to control the temperature. 
    2. Add a display that graphs both the intended set point and the temperature over time.
      1. Provide a way for the user to download these graphs as records
    3. Add some security and expose website so anyone can see it

    My next goal is to integrate this cherrypy web framework with the existing fermenter control code. Once I can control the fermenter with the web page I'll go back and figure out how to make this thing look good, add some security, and expose it to the outside world.

  • Temperature Schedule

    Krockwell03/22/2020 at 19:27 0 comments

    Over the last week I've been working on the scheduling aspect of this project. The goal is to be able to setup a schedule, or profile, that the fermenter will follow. In the rpi_beers project there is now a script titled "generate_calendar" which accepts a file containing the step temperature (Fahrenheit) and step duration (days) organized in a comma-seperated list. The example below would set the temperature at 65 for 1 day, then raise to 67 for 1 day, then raise to 68 and sit at that temperature for 14 days before raising to 72 to finish out the last 7 days. The "generate_calendar" script will take in this file and output a JSON-formatted "calendar" file.

    The script currently assumes that day 1 is the current date, though I expect to change this in a future revision. If the input is less than 30 days, the calendar will extend the last temperature out to reach a full 30 days.

    Example profile (temperature, days):

    65, 1

    67, 1

    68, 14

    72, 7

    Example output (JSON format, created March 22, 2020):

    {"08 Apr 2020 ": "72", "04 Apr 2020 ": "68", "18 Apr 2020 ": "72", "14 Apr 2020 ": "72", "10 Apr 2020 ": "72", "30 Mar 2020 ": "68", "09 Apr 2020 ": "72", "22 Mar 2020 ": "65", "05 Apr 2020 ": "68", "01 Apr 2020 ": "68", "13 Apr 2020 ": "72", "27 Mar 2020 ": "68", "19 Apr 2020 ": "72", "28 Mar 2020 ": "68", "15 Apr 2020 ": "72", "11 Apr 2020 ": "72", "31 Mar 2020 ": "68", "17 Apr 2020 ": "72", "07 Apr 2020 ": "72", "03 Apr 2020 ": "68", "23 Mar 2020 ": "67", "20 Apr 2020 ": "72", "25 Mar 2020 ": "68", "16 Apr 2020 ": "72", "12 Apr 2020 ": "72", "24 Mar 2020 ": "68", "29 Mar 2020 ": "68", "06 Apr 2020 ": "68", "26 Mar 2020 ": "68", "02 Apr 2020 ": "68"}

  • Prioritizing Work

    Krockwell03/10/2020 at 07:20 0 comments

    Last week when I restarted this projected I listed out the steps necessary to get a minimum viable product, i.e. the bare-minimum I needed to monitor and control the temperature of my fermenting beer. I've now got this up and running and my two fermenting beers are safe! The next step is to setup temperature profiling before the next brew day (1st week of April).

    Temperature profiling: The program should accept multiple temperature set points with corresponding time intervals. For example, to make my favorite munich lager I would use this profile: Start at 48F for 1 day to match pitch temperature, hold at 48F for 4 days, raise to 53F for 4 days, raise to 60F for 4 days (diacetyl rest), ramp down temperature 4F per day to hit 33F and then hold for 6 weeks (lagering).

    So far, the project has been hacked together with random bits of wires/project boards and the software is a mess... Eventually I'll need to go back and clean this up, but for now I want to keep the momentum going and knock out the final objective of the base project

    I wanted to add a specific gravity measurement to this project, it would be really interesting to see how gravity changes during the fermentation process. There are some solutions out there -a bluetooth enabled hydrometer called Tilt and a bluetooth enabled bubble counter that fits on top of the airlock. I don't like either of these solutions, so I've been trying to figure out how to measure gravity using mass and volume. My first attempt will use a scale/stress gauge to measure mass and a time-of-flight sensor to measure the beer liquid level to determine volume. I'm ordering those parts now, should have them arriving to play around with next week.

    I also pulled the step files from this awesome keezer build in hackaday by Ben Brooks (https://hackaday.io/project/167023-keezer-kegtapbeer-controller). Working with a buddy to print these out, I think the scale he's designed would work well for determining the mass.

  • Temperature Control Works!

    Krockwell03/09/2020 at 02:42 0 comments

    Today I hooked up the raspberry pi to the fridge and added some code to control turning the fridge on and off. If the temperature is 2 degrees below the set point then the fridge turns off, if the temperature is above the set point and it's been atleast 10 minutes since the last on-time then the fridge turns on. That extra time delay is intended to minimize the number of times I turn the fridge on/off. I expect to be updating this logic as I brew a few more beers and get a feel for it. I've got 2 beers in the fridge right now which have been in there for about 2 weeks - a Gumball Head by 3Floyds clone and a Hazy IPA.

    The output below shows timestamp, temperature, relay status. Here you can see the fridge shutting off once it cools down to 68F. Commit: 6236f98

  • Testing the Relay

    Krockwell03/04/2020 at 06:29 0 comments

    Received the DLI IOT Relay today for about $20 on Amazon Prime. This box is a SPDT relay that controls 3 AC outlets, two of which are normally off and one is normally on. The fourth outlet is always on, which is handy as I plan to use it to power the raspberry pi.

    Link to datasheet: https://cdn-shop.adafruit.com/product-files/2935/P2935B+datasheet.pdf

    I setup a quick test to turn a lamp on and off using the relay and a python script. I used the RPi.GPIO library that comes standard with Rasbian. I should note there are different GPIO numbering modes, in this case I use "BCM" which is based on the broadcom chip and NOT the header pin numbering. This bugs me, I will probably use the board pin numbering next time, designated as "BOARD".

    #!/usr/bin/env python
    import RPi.GPIO as GPIO
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(17, GPIO.OUT)
    GPIO.output(17, GPIO.HIGH)
    IOT Relay
    First test with the IOT Relay

  • Previous Work

    Krockwell03/01/2020 at 19:52 0 comments

    I am not starting this project from scratch, some work I had done a few years ago. I've outlined that work below and included references to some helpful tutorials/posts out there that I used to start out.

    The first step was to setup the Raspberry PI with a temperature probe. I used the DS18B20 temperature probe because it was readily available, covers the expected temperature range, and multiple probes can be used with minimal wiring. Setting this up was relatively straightforward, I followed the adafruit guide linked below.

    Adafruit guide on setting up the DS18B20:  https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing

    Running python script on boot: http://blog.scphillips.com/posts/2013/07/getting-a-python-script-to-run-in-the-background-as-a-service-on-boot/

    The second step was to save temperature data in order to plot it. I wrote a python script to record the timestamped temperature data and save it to a file. A separate script was used to plot this data using GNUPlot and save the plot as an image.

    More information on how GNUPlot works: http://raspberrypi.tomasgreno.cz/plotting-graphs.html

    In order to display these graphs, I setup the raspberry pi with a network location and a page which displays the temperature graph. The guide was very helpful in setting up the NodeJS on the Raspberry PI: http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/

    Website hosting on Raspberry PI: http://readwrite.com/2014/06/27/raspberry-pi-web-server-website-hosting 

    My codebase is on Github at https://github.com/Krockwell/rpi_beers

    Raspberry PI with two temperature sensors
    Raspberry PI with temperature sensors
    Hosted webpage to display temperature plots
    Web page, hosted on RPI, displaying temperature plots

  • First Post: Goals

    Krockwell03/01/2020 at 19:29 0 comments

    I first started this project about 5 years ago but didn't end up finishing it. Always thought it would be a fun project to finish, hopefully keeping track of it on hackaday will keep me motivated to finish.


    Goals for this project:

    1. Control the temperature of the fermenter
    2. Display temperature vs time on smart phone
    3. Program temperature profiles
    4. Learn stuff, have fun, drink beer


    Additional/Stretch Goals:

    1. Expand feature set to create a "smart kegerator" as well.
      1. Track temperature, pressure, and weight of each keg
      2. Provide LED lighting on inside of the freezer
    2. Keep track of beers fermenting/on-tap with information from BeerSmith