HOWTO - Make a BrewPi Fermentation Controller For Cheap

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Status
Not open for further replies.
Edit: typing badly on stupid tablet virt keyboard made bad post. Me no likely virtual keyboard.
 
Download the CSV (maintenance, previous beers, pick beer name, download), open that in excel, or notepad or if on Linux whatever editor, scour data for clues at end or throughout. Maybe it points to something the json additions are doing or not doing
 
Those graphs look like your temp probes are going back in time
 
Those graphs look like your temp probes are going back in time

That's what I think too; and looking at the text file /var/www/data/<beername>/<beername>.json might show something so that's why I asked him to download the csv or get the json to see if there's something stuck in there.

Now, *HOW* it got messed up, that's another question.
 
Could be bad calls to a time server. The raspberry pie doesn't have a real onboard clock like a pc does. It may be attributing to the bad sensor data as well.
 
Could be bad calls to a time server. The raspberry pie doesn't have a real onboard clock like a pc does. It may be attributing to the bad sensor data as well.

He's on a laptop. Been having issues with power supply and possible RF interference therefrom.
 
Is there any reason to use an SD card larger than 8GB? I just got my pi and will be hacking this together this weekend. I have a 32GB SD card, but i have a feeling that is overkill, especially since i intend to clone the completed brewpi SD card as a backup.
 
Is there any reason to use an SD card larger than 8GB? I just got my pi and will be hacking this together this weekend. I have a 32GB SD card, but i have a feeling that is overkill, especially since i intend to clone the completed brewpi SD card as a backup.

No. In fact a 4GB card will work.
 
Here's a drawing of the circuit that I built on a Radio Shack Prototype Shield (plugs right on top of an Uno). It's based on the BrewPi Rev C shield schematic and uses a 20x4 LCD, a 74HC595 Shift Register and a couple of 10K pull-up resistors.

i followed this diagram to a t is there some other step to get the lcd working
 
i followed this diagram to a t is there some other step to get the lcd working

I just took a quick look at the diagram and noticed a mistake. The black line(s) from the lcd should be connected to the ground rail instead of the power rail. As it's drawn you won't even get the backlight to turn on. The red and black on the drawing are consistent: all of the red lines should be connected to the 5V rail, and all black lines are (or should be) connected to ground. See if that helps!
 
I just took a quick look at the diagram and noticed a mistake. The black line(s) from the lcd should be connected to the ground rail instead of the power rail. As it's drawn you won't even get the backlight to turn on. The red and black on the drawing are consistent: all of the red lines should be connected to the 5V rail, and all black lines are (or should be) connected to ground. See if that helps!

actually i didnt notice that either, so it isnt the problem
 
Ok so I've still got problems with interference and charts. I'm already working on the interference and I'm waiting for some items I ordered to come in. I don't think the two problems are connected though.

I was running a new brew all day yesterday from 2 PM and everything was fine until midnight. At midnight, the chart went back to the pictures I posted earlier. I couldn't navigate at all, except for on my phone. When on my phone, I could navigate the chart and once again the ends of the charts were connected by straight lines to the beginning of the chart. Almost like the new charts are trying to start at the beginning or something.

So I check the logs and it said "new day, new JSON file created" again. Either it's not supposed to create a new JSON, or something is screwing it up when it creates the new JSON.

Any suggestions?
 
I'm looking at your graph that loses the timestamp horizontal axis and can't help but wonder if the data file it's logging has a glitch and whether it can be fixed. The data file is just a text file (I've been looking at these but am not expert). The BrewPi software holds the logged data in <brewname>.json and simultaneously builds a <brewname>.csv file. They live in /var/www/data/<brewnam> directory in Linux world. Each day seems to be another json file, for instance when I look in mine I see this:
root@debianinspiron:/var/www/data/AlaskanAmber5# ls -lrt
total 588
-rw-r--r-- 1 brewpi brewpi 40943 Jul 26 23:58 AlaskanAmber5-2014-07-26.json
-rw-r--r-- 1 brewpi brewpi 20728 Jul 27 06:43 AlaskanAmber5-2014-07-27.json
-rw-r--r-- 1 brewpi brewpi 47488 Jul 27 21:06 AlaskanAmber5-2014-07-27-1.json
-rw-r--r-- 1 brewpi brewpi 9293 Jul 27 23:58 AlaskanAmber5-2014-07-27-2.json
-rw-r--r-- 1 brewpi brewpi 75489 Jul 28 23:58 AlaskanAmber5-2014-07-28.json
-rw-r--r-- 1 brewpi brewpi 76311 Jul 29 23:59 AlaskanAmber5-2014-07-29.json
-rw-r--r-- 1 brewpi brewpi 74615 Jul 30 23:59 AlaskanAmber5-2014-07-30.json
-rw-r--r-- 1 brewpi brewpi 216610 Jul 31 06:46 AlaskanAmber5.csv
-rw-r--r-- 1 brewpi brewpi 21746 Jul 31 06:46 AlaskanAmber5-2014-07-31.json
root@debianinspiron:/var/www/data/AlaskanAmber5#

Having said all that, the json is a messy thing but might have something simple incorrectly sitting at the end that makes the graph suddenly track back to the begginning of time. Can you look at the files? Can you download the CSV itself and view in an editor or Excel to see what the last datapoint is?
 
Are you still running off that same laptop. If be willing to bet there are some CMOS clock errors affecting the os
 
I'm looking at your graph that loses the timestamp horizontal axis and can't help but wonder if the data file it's logging has a glitch and whether it can be fixed. The data file is just a text file (I've been looking at these but am not expert). The BrewPi software holds the logged data in <brewname>.json and simultaneously builds a <brewname>.csv file. They live in /var/www/data/<brewnam> directory in Linux world.

Having said all that, the json is a messy thing but might have something simple incorrectly sitting at the end that makes the graph suddenly track back to the begginning of time. Can you look at the files? Can you download the CSV itself and view in an editor or Excel to see what the last datapoint is?

I am able to download the .csv file and I was graphing it in excel the other day. The data seem fine and continue after midnight. I don't think there's anything wrong with it. I'll take a closer look later.

Are you still running off that same laptop. If be willing to bet there are some CMOS clock errors affecting the os

You might be onto something here. I wonder how I could check that. I was thinking about installing Ubuntu on my desktop and seeing if the problems continue. I doubt they will though. If it is what you're saying, how would that be fixed? Another option I was considering was completely removing my Ubuntu partition on my laptop and starting from scratch. Would that work?
 
I'm using debian wheezy on a lappy. I know it installs many packages compared to pi. I am a noob on this space but just kept googling as I installed. I have it on a partition as well. I would prob try to see if there was an auto time update happening in the background somewhere in the full install.


Sent from my iPhone using Home Brew
 
I'm not a coder. How would I go about extracting just the lcd portion of the webui. So I can embed it into a front page that only has the lcd portions for each of my fermenters in a 2x2 layout.
 
Having me some ideas ImageUploadedByHome Brew1406953254.990772.jpg
 
I'm not a coder. How would I go about extracting just the lcd portion of the webui. So I can embed it into a front page that only has the lcd portions for each of my fermenters in a 2x2 layout.

How are they currently running the web interface?
Does each run on a separate port?
 
How are they currently running the web interface?

Does each run on a separate port?


So far I just have them in separate folders. I haven't found a need to virtualize each instance as they just run out the box. But whatever way needs to be done to make this work I'll try it.
 
I've corrected a wiring error and have edited my original post so have another look HERE


What's the part numbers for the new parts you added to the schematic. Also can you post the pinout of your shift register.

I appreciate you helping. I have tried to get my lcd up and running a few times now. But all I get is an lcd that lights up with the 1st and 3rd lines with solid blocks.
 
So far I just have them in separate folders. I haven't found a need to virtualize each instance as they just run out the box. But whatever way needs to be done to make this work I'll try it.


So, what web address do you access each one on?
 
192.168.1.18/top1/
192.168.1.18/top2/
192.168.1.18/bottom1/
192.168.1.18/bottom2/

OK, so in each web folder (top1, top2, bottom1, bottom2) create a file called "lcd.php", with the following contents:
Code:
<?php
/* Copyright 2012 BrewPi/Elco Jacobs.
 * This file is part of BrewPi.

 * BrewPi is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * BrewPi is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with BrewPi.  If not, see <http://www.gnu.org/licenses/>.
 */

// load default settings from file
$defaultSettings = file_get_contents('defaultSettings.json');
if($defaultSettings == false){
	die("Cannot open default settings file: defaultSettings.json");
}
$settingsArray = json_decode(prepareJSON($defaultSettings), true);
if(is_null($settingsArray)){
	die("Cannot decode defaultSettings.json");
}
// overwrite default settings with user settings
if(file_exists('userSettings.json')){
	$userSettings = file_get_contents('userSettings.json');
	if($userSettings == false){
		die("Error opening settings file userSettings.json");
	}
	$userSettingsArray = json_decode(prepareJSON($userSettings), true);
	if(is_null($settingsArray)){
		die("Cannot decode userSettings.json");
	}
	foreach ($userSettingsArray as $key => $value) {
		$settingsArray[$key] = $userSettingsArray[$key];
	}
}

$beerName = $settingsArray["beerName"];
$tempFormat = $settingsArray["tempFormat"];
$profileName = $settingsArray["profileName"];
$dateTimeFormat = $settingsArray["dateTimeFormat"];
$dateTimeFormatDisplay = $settingsArray["dateTimeFormatDisplay"];

function prepareJSON($input) {
    //This will convert ASCII/ISO-8859-1 to UTF-8.
    //Be careful with the third parameter (encoding detect list), because
    //if set wrong, some input encodings will get garbled (including UTF-8!)
    $input = mb_convert_encoding($input, 'UTF-8', 'ASCII,UTF-8,ISO-8859-1');

    //Remove UTF-8 BOM if present, json_decode() does not like it.
    if(substr($input, 0, 3) == pack("CCC", 0xEF, 0xBB, 0xBF)) $input = substr($input, 3);

    return $input;
}

?>
<!DOCTYPE html >
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<title>BrewPi reporting for duty!</title>
		<link type="text/css" href="css/redmond/jquery-ui-1.10.3.custom.css" rel="stylesheet" />
		<link type="text/css" href="css/style.css" rel="stylesheet"/>
		<link rel="apple-touch-icon" href="touch-icon-iphone.png">
        <link rel="apple-touch-icon" sizes="76x76" href="touch-icon-ipad.png">
        <link rel="apple-touch-icon" sizes="120x120" href="touch-icon-iphone-retina.png">
        <link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad-retina.png">
        <meta name="apple-mobile-web-app-title" content="BrewPi">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <link rel="apple-touch-startup-image" href="splash.png" />
	</head>
	<body>
		
		<div id="lcd" class="lcddisplay"><span class="lcd-text">
		<span class="lcd-line" id="lcd-line-0">Live LCD waiting</span>
		<span class="lcd-line" id="lcd-line-1">for update from</span>
		<span class="lcd-line" id="lcd-line-2">script...</span>
		<span class="lcd-line" id="lcd-line-3"></span>

		</div>
		<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.10.3.custom.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-timepicker-addon.js"></script>
		<script type="text/javascript" src="js/spin.js"></script>
		<script type="text/javascript" src="js/dygraph-combined.js"></script>
		<script type="text/javascript">
			// pass parameters to JavaScript
			window.tempFormat = <?php echo "'$tempFormat'" ?>;
			window.beerName = <?php echo "\"$beerName\""?>;
			window.profileName = <?php echo "\"$profileName\""?>;
			window.dateTimeFormat = <?php echo "\"$dateTimeFormat\""?>;
			window.dateTimeFormatDisplay = <?php echo "\"$dateTimeFormatDisplay\""?>;
		</script>
		<script type="text/javascript" src="js/main.js"></script>
		<script type="text/javascript" src="js/device-config.js"></script>
		<script type="text/javascript" src="js/control-panel.js"></script>
		<script type="text/javascript" src="js/maintenance-panel.js"></script>
		<script type="text/javascript" src="js/beer-chart.js"></script>
		<script type="text/javascript" src="js/profile-table.js"></script>
		
	</body>
</html>

Then, in one of the folders (whichever you want), create a file called "multiLCD.html" (or whatever you want), and put the following code in it:
Code:
<html>
<body>
<iframe src="http://192.168.1.18/top1/lcd.php"></iframe>
<iframe src="http://192.168.1.18/top2/lcd.php"></iframe><br/>
<iframe src="http://192.168.1.18/bottom1/lcd.php"></iframe>
<iframe src="http://192.168.1.18/bottom2/lcd.php"></iframe>
</body>
</html>

Then, go to http://192.168.1.18/top1/multiLCD.html (assuming "top1" is the folder you put the multiLCD file in) and be happy with yourself :D

Should work...
 
How many people here are using cheap ass fotek ssr's. I have a couple laying around and have been doing some tests to see if I could use one to run my fridge. Since elco seems to think its stupid to use relays. But I found that the voltage produced by the arduino really isn't enough to get an ssr to open up reliably. Or I have something weird going on with my ssr. When I use the arduini to trip the ssr with 120v going into the ssr and my multimeter I only read 89volts coming through the ssr. And it makes since because my mypin controllers use the same ssr's and regulate the temperature by regulating the dc voltage. The arduino only puts out 4.8-5vdc and my ssr reads 89v, the mypin outputs 8-9v and I get 100-115v depending on the duty cycle. I don't think my fridge is going to be happy only running 90volts to the compressor.
 
Just flipping awesome...

My tap water was about 65f and cooled the wort to about 68f - by the time I had oxygenated it it has risen to 71f or so - ambient was close to 90f. Here's a screen shot from the first seven hours of fermentation - Brewpi and my 5K BTU A/C unit brought it down to 66 in a few hours and is holding it quite steady now..

awesome.jpg
 
How many people here are using cheap ass fotek ssr's. I have a couple laying around and have been doing some tests to see if I could use one to run my fridge. Since elco seems to think its stupid to use relays. But I found that the voltage produced by the arduino really isn't enough to get an ssr to open up reliably. Or I have something weird going on with my ssr. When I use the arduini to trip the ssr with 120v going into the ssr and my multimeter I only read 89volts coming through the ssr. And it makes since because my mypin controllers use the same ssr's and regulate the temperature by regulating the dc voltage. The arduino only puts out 4.8-5vdc and my ssr reads 89v, the mypin outputs 8-9v and I get 100-115v depending on the duty cycle. I don't think my fridge is going to be happy only running 90volts to the compressor.

Hmmm... The last picture you had posted shows diode's in series - they drop between 0.3 to 0.7V - try removing them.
 
What are the diodes for? using three discrete outputs on one relay?

Sort of. My intention is to setup multiple instances of brewpi. All allowed to control the refrigeration. The diodes provide leak-back protection to keep voltage from traveling back to separate arduinios. I intend to close off the cold plate portion of the freezer and make it into a chilled-air reservoir. Using fans to move air into 4 separate chambers with heat tape ferm-wraps to control heating. I still need more arduinos and still need to partition everything off. But I'm starting to figure out how it's all gonna work.
 
Hmmm... The last picture you had posted shows diode's in series - they drop between 0.3 to 0.7V - try removing them.


Tried that… still getting 89v. I have noticed that when I leave the ssr activated and remove and replace one of the line leads then I get full voltage again. I wonder if it's just because my multimeter doesn't actually draw significant power over the ssr. Or I'm using a faulty ssr.
 
I have a feeling it may be better to use a 12v source and do the switching from relay boards set up to each arduino. That way I'm using the same power source for switching. Negating the need for the diodes. And I can guarantee enough voltage to fully trip the ssr.
 
I'm using relays as of now. But elco brought up some good points about arcing that I can't ignore given the size of my compressor. Right now I use the relay to trip the non-crossing timer relay inside the fridge. I wanted to remove those parts and go with an ssr solely to gain a little more space and remove the defrost heater from the equation. Even though the fridge never runs long enough to switch over to the defrost cycle.
 
I'm using relays as of now. But elco brought up some good points about arcing that I can't ignore given the size of my compressor. Right now I use the relay to trip the non-crossing timer relay inside the fridge. I wanted to remove those parts and go with an ssr solely to gain a little more space and remove the defrost heater from the equation. Even though the fridge never runs long enough to switch over to the defrost cycle.

How about an arduino hooked to an arduino?

Output of one connected to input pins on another and the program on the second arduino can sequence them anyway you like?

Arduino's are cheap - I've got no less than a couple dozen of them around here in various forms.

As far as frosting a fridge up - I had a similiar problem on my ferm-chamber - the ac unit would frost up when trying to cold-crash. I connected a STC-1000 between the brewpi and the AC, set the STC for 0c and put the probe into the evaporator of the AC unit. In the industry this is called a "Freezestat" and shuts down the unit before the coils freeze up. The STC shuts it down and then the restart timer is 10 minutes if I remember correctly. I havent had it freeze up since.

I should document it better - Its doing the same thing as a $300 Coolbot.
 
Too many things that can go wrong I just want simple on off control of the freezer element
 
Status
Not open for further replies.

Latest posts

Back
Top