Happy HolidaySs Giveaway - Last Sponsor Giveaway of the Year!

Come Enter the BrewDeals/FastFerment Giveaway!


Home Brew Forums > Home Brewing Beer > DIY Projects > Fermenters > Monitoring/controlling with Linux on the cheap
Reply
 
LinkBack Thread Tools
Old 09-11-2012, 02:19 AM   #231
scruffymmh
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jan 2011
Location: Albany, New York
Posts: 52
Default

Thanks for the replies. I actually decided to get a Raspberry Pi board today, and ordered that. I realize, however, that this is not a turnkey solution, it's really just a replacement for the laptop that I was going to use.

But, what I really need assistance on now is the other components and how they will fit together with the RaspPi. I know there's a separate Raspberry Pi thread, but figured I'd post here because there are others trying to follow along. I don't mean to hijack this thread.

Based on some research I did in reading the RaspPi forums and some wikis, I might consider using a breakout kit, such as something like this to basically give some more room and options for hooking up other hardware (like the temp sensor(s). I could mount the RaspPi in an enclosure like this and lead the ribbon cable out to a breadboard for connection with the other devices, though I have no idea how the breadboard really works. Or then there's this Pi Plate but I don't really get the difference or how that might benefit me over the breakout/breadboard option.

So what does everyone/anyone recommend for me in terms of hardware for the rest of this setup in order to temp monitor and control? For instance, what do I need between the temp sensors that I have (DS18S20+ from Maxim) and the RaspPi unit? That's where I need help - that and then how to setup the power outlet control/relay to actually swtich on/off my fridge or heater.

I think, but I'm not sure, that I need some separate board that the temp sensors lead into, and that plugs into the Rasp Pi somehow. But I'm lost with that - I don't know what will work or what I should/could use. And I don't know how the DS2406+ switches fit into the equation.

I am most appreciative if anyone can offer further assistance.

__________________
scruffymmh is offline
 
Reply With Quote Quick reply to this message
Old 09-11-2012, 12:47 PM   #232
jimmayhugh
Turgid Member
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
jimmayhugh's Avatar
Recipes 
 
Join Date: Feb 2011
Location: Las Vegas, NV
Posts: 605
Liked 49 Times on 43 Posts
Likes Given: 2

Default

I've got my Raspberry Pi, and installed the Adafruit distro, so I'll be looking into the setup over the next few weekends.

I'm also giving some serious thought to using an Aduino board for the hardware interfacing, as I have some experience with that, and the 1-wire libraries are solid, and then just using I2C to communicate the data to/from the RPi, and let the RPi do the ethernet/wireless/web work. This looks like a good way to easily set up a multi-drop temp/SSR system for HERMS/RIMS/pump control.

It's a great time to be a computer/beer geek!!!

__________________
TeensyNet Networked Controller
ButtCrack Brewery
And This Is Why We Drink...
Cogito, ergo bibere cervisia sum
jimmayhugh is offline
 
Reply With Quote Quick reply to this message
Old 10-15-2012, 11:00 PM   #233
KokomoSam
HBT_SUPPORTER.png
Feedback Score: 0 reviews
Recipes 
 
Join Date: Feb 2012
Location: VillaPark, IL
Posts: 44
Liked 5 Times on 4 Posts
Likes Given: 4

Default

Thanks GatorDad for starting such a great thread. I am coming to this thread late, but it seems like a good time. Lots of good information and options for monitoring fermentation on HBT and some commercial options http://brewpi.com/ , http://www.thebeerbug.com/. I have a Raspberry Pi on order and may possibly add an Arduino similar to brew.pi. I will be adding more elegant options once I get the Raspberry Pi hooked up with my fermentation chamber which I will share when it happens. In the mean time using this thread as inspiration, I have set up a Debian server on an old Mac Mini and got a temp sensor reporting like GatorDad describes. This is just monitoring temps at my desk for testing, not an active fermentation. Ultimately, I want to be able to see a near real-time graph of fermentation temperatures via the web from anywhere. With my limited scripting skills, I have hacked together a simple solution for creating and updating a graph every 5 minutes to be served on a local apache web server. I have decided to share it back to the thread in case anyone can take inspiration from my hack.

Below are the two scripts I use to accomplish this. I am not a professional coder and I knocked these together in an evening, so buyer beware... These work but are an ugly hack.


logger.sh

Code:
#!/bin/bash
# SB - 10/10/2012
# Script to grab the temp in C and convert to F
# Log values to /var/log/messages
# Write timestamp and temp to csv file
# run with crontab entry  */5 * * * * /opt/scripts/logger.sh

# Grab time in epoch time convert to CTZ with DST and store
#  note:  will need to adjust for lack of DST later
datetemp=`date +"%s"`
date=$(($datetemp - 18000))
#echo $date

# pull temp reading from OWFS
fermtemp=`sudo cat /media/fermtemp`

# strip off any spaces
temp1=`echo $fermtemp | tr -d ' '`

# do the math to convert C to F using bc to handle decimals
temp=`echo "$temp1 * 1.8 + 32" | bc`

#fixme: clean up/remove the multiple variables/steps used for debugging when written

# log the value to var messages
logger -t fermtemp "$date,$temp degrees F"

# write value and date to file
echo "$date,$temp" >> /opt/scripts/TempertureReadings.csv

# Get Last 30 days or 8640 5 min readings and place in new file
tail -8640 /opt/scripts/TempertureReadings.csv > /opt/scripts/Last30Days.csv

#fixme: clean up/remove the multiple files used for debuging when written

# Generate graph with last 30 days worth of data write to web server root directory
/opt/scripts/CreateGraph.sh > /var/www/TempGraph.png

CreateGraph.sh
Code:
#!/usr/bin/gnuplot
# SB - 10/10/2012
# Create PNG of graph using gnuplot for the last 30 days worth of data


reset
clear
set datafile separator ","
set terminal png font "/usr/share/fonts/msttcorefonts/arial.ttf" 10
#set terminal png size 900,400
set xtics nomirror rotate by -45 font ",8"
set title "Sam's Desk Temp (F) over Time"
set yrange [55:80]
set bmargin 5
set ylabel "Temp"
set xdata time
set timefmt "%s"
set format x "%m-%d %H%M"
set key left top
set grid
plot "/opt/scripts/Last30Days.csv" using 1:2 with lines lw 2 lt 3 title 'Temp'

#plot "/opt/scripts/TempertureReadings.csv" using 1:2 with lines lw 2 lt 3 title 'Temp'

Here is a sample of the output...
__________________

Reason: fixing typos
KokomoSam is online now
 
Reply With Quote Quick reply to this message
Old 11-19-2012, 05:57 PM   #234
bfinleyui
Feedback Score: 0 reviews
Recipes 
 
Join Date: Nov 2012
Posts: 371
Liked 17 Times on 17 Posts
Likes Given: 44

Default

Subscribing to this thread. Got some maxim samples ordered, already have a pi, breadboard on its way, looking to do a single-stage controller with a (free) mini fridge I got (assuming the bucket will fit, otherwise it'll just control the 120mm fans inside my son of fermentation cooler), got a solid-state relay. Hoping to put it all together without killing myself on the main soon

__________________
Primary: None
Bottled: Cinnamon Apple Cider, Two Hearted Clone, FW Double Jack Clone
Kegged: House Pale Ale, Russian Imperial Stout, Milk Chocolate Stout/Porter Partigyle, Graff
Conditioning:
On Deck: DIPA w/Heady Topper Yeast, Winter Warmer, Imperial Red
bfinleyui is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 12:29 AM   #235
helibrewer
HBT_SUPPORTER.png
Feedback Score: 1 reviews
 
helibrewer's Avatar
Recipes 
 
Join Date: Nov 2011
Location: Santa Rosa, CA
Posts: 3,490
Liked 250 Times on 219 Posts
Likes Given: 62

Default

Quote:
Originally Posted by scruffymmh View Post
Thanks for the replies. I actually decided to get a Raspberry Pi board today, and ordered that. I realize, however, that this is not a turnkey solution, it's really just a replacement for the laptop that I was going to use.

But, what I really need assistance on now is the other components and how they will fit together with the RaspPi. I know there's a separate Raspberry Pi thread, but figured I'd post here because there are others trying to follow along. I don't mean to hijack this thread.

Based on some research I did in reading the RaspPi forums and some wikis, I might consider using a breakout kit, such as something like this to basically give some more room and options for hooking up other hardware (like the temp sensor(s). I could mount the RaspPi in an enclosure like this and lead the ribbon cable out to a breadboard for connection with the other devices, though I have no idea how the breadboard really works. Or then there's this Pi Plate but I don't really get the difference or how that might benefit me over the breakout/breadboard option.

So what does everyone/anyone recommend for me in terms of hardware for the rest of this setup in order to temp monitor and control? For instance, what do I need between the temp sensors that I have (DS18S20+ from Maxim) and the RaspPi unit? That's where I need help - that and then how to setup the power outlet control/relay to actually swtich on/off my fridge or heater.

I think, but I'm not sure, that I need some separate board that the temp sensors lead into, and that plugs into the Rasp Pi somehow. But I'm lost with that - I don't know what will work or what I should/could use. And I don't know how the DS2406+ switches fit into the equation.

I am most appreciative if anyone can offer further assistance.
Here's the way to wire them together:



And here's how to configure it:

Configuring Raspberry Pi
1.The latest Wheezy image contains w1 support in the kernel.

2.You don’t have to use HDMI display and USB keyboard – you can connect it to your laptop or network using Ethernet and let RasPi obtain the DHCP address and connect to it using ssh using pi/raspberry as login/password.

3.Connect LED/Sensor as shown above.

4.Load 1-wire kernel modules that come pre-installed but not loaded: sudo modprobe w1-gpio and then sudo modprobe w1_therm

5.Add lines w1-gpio and w1_therm into /etc/modules using sudo nano /etc/modules so they get loaded automatically next time you restart it.

6.Find your sensor: ls /sys/bus/w1/devices/ it should look like 28-xxxxxxxxxxxx or 10-xxxxxxxxxxxx
__________________
Something is always fermenting....
"It's Bahl Hornin'"

Primary:
Brite Tank/Lagering:
Kegged: Hefeweizen, Chocolate Hazelnut Porter, Kumquat Saison, Tart Cherry Cider, Belgian Tripel, Maibock Bock, Ommegang Abbey Ale Clone, Belgian Golden Strong, German Pils (WLP830)
Bottled: Belgian Quad (Grand Reserve), Derangement (Belgian Dark Strong)
On Deck:
My Site: www.restlesscellars.com
helibrewer is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 01:18 AM   #236
hipturn
Feedback Score: 0 reviews
Recipes 
 
Join Date: Nov 2010
Location: nonya, GA
Posts: 22
Liked 2 Times on 1 Posts
Likes Given: 1

Default

Subscribed

__________________
hipturn is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 02:00 AM   #237
FuzzeWuzze
HBT_SUPPORTER.png
Feedback Score: 0 reviews
 
FuzzeWuzze's Avatar
Recipes 
 
Join Date: Jun 2012
Location: Hillsboro, OR
Posts: 2,184
Liked 244 Times on 185 Posts
Likes Given: 19

Default

Quote:
Originally Posted by KokomoSam View Post
Thanks GatorDad for starting such a great thread. I am coming to this thread late, but it seems like a good time. Lots of good information and options for monitoring fermentation on HBT and some commercial options http://brewpi.com/ , http://www.thebeerbug.com/. I have a Raspberry Pi on order and may possibly add an Arduino similar to brew.pi. I will be adding more elegant options once I get the Raspberry Pi hooked up with my fermentation chamber which I will share when it happens. In the mean time using this thread as inspiration, I have set up a Debian server on an old Mac Mini and got a temp sensor reporting like GatorDad describes. This is just monitoring temps at my desk for testing, not an active fermentation. Ultimately, I want to be able to see a near real-time graph of fermentation temperatures via the web from anywhere. With my limited scripting skills, I have hacked together a simple solution for creating and updating a graph every 5 minutes to be served on a local apache web server. I have decided to share it back to the thread in case anyone can take inspiration from my hack.

Below are the two scripts I use to accomplish this. I am not a professional coder and I knocked these together in an evening, so buyer beware... These work but are an ugly hack.


logger.sh
Code:
#!/bin/bash
# SB - 10/10/2012
# Script to grab the temp in C and convert to F
# Log values to /var/log/messages
# Write timestamp and temp to csv file
# run with crontab entry  */5 * * * * /opt/scripts/logger.sh

# Grab time in epoch time convert to CTZ with DST and store
#  note:  will need to adjust for lack of DST later
datetemp=`date +"%s"`
date=$(($datetemp - 18000))
#echo $date

# pull temp reading from OWFS
fermtemp=`sudo cat /media/fermtemp`

# strip off any spaces
temp1=`echo $fermtemp | tr -d ' '`

# do the math to convert C to F using bc to handle decimals
temp=`echo "$temp1 * 1.8 + 32" | bc`

#fixme: clean up/remove the multiple variables/steps used for debugging when written

# log the value to var messages
logger -t fermtemp "$date,$temp degrees F"

# write value and date to file
echo "$date,$temp" >> /opt/scripts/TempertureReadings.csv

# Get Last 30 days or 8640 5 min readings and place in new file
tail -8640 /opt/scripts/TempertureReadings.csv > /opt/scripts/Last30Days.csv

#fixme: clean up/remove the multiple files used for debuging when written

# Generate graph with last 30 days worth of data write to web server root directory
/opt/scripts/CreateGraph.sh > /var/www/TempGraph.png

CreateGraph.sh
Code:
#!/usr/bin/gnuplot
# SB - 10/10/2012
# Create PNG of graph using gnuplot for the last 30 days worth of data


reset
clear
set datafile separator ","
set terminal png font "/usr/share/fonts/msttcorefonts/arial.ttf" 10
#set terminal png size 900,400
set xtics nomirror rotate by -45 font ",8"
set title "Sam's Desk Temp (F) over Time"
set yrange [55:80]
set bmargin 5
set ylabel "Temp"
set xdata time
set timefmt "%s"
set format x "%m-%d %H%M"
set key left top
set grid
plot "/opt/scripts/Last30Days.csv" using 1:2 with lines lw 2 lt 3 title 'Temp'

#plot "/opt/scripts/TempertureReadings.csv" using 1:2 with lines lw 2 lt 3 title 'Temp'

Here is a sample of the output...
If your goal is just to see your temps and not actively control anything(like in a fermentation controller) why not just use COSM?
Its free and lets you push data to it to do exactly what your trying to do. http://www.cosm.com

I got a Arduino Uno/Wiznet Ethernet shield off Dealextreme for $30, and a month later(they have super slow shipping) i had them, i use it to push data to COSM.

Throw a pair of DS18B20's on some thermostat wire, and shove one down my thermowell in my bucket, made a small app on the arduino using the COSM API code, and you have something like this. Both of these are images that are being pulled live by COSM whenever the image is displayed with the most up to the second data, i wrote zero code to do this. For this graph posting here i just chose 3 hour interval, it can go all the way up to a week or more with the embedded graph image builder, but since i just reset my data it would be empty and boring to look at All i do is take data every 5 seconds and push it to COSM over the ethernet port.
And yes i realized 5s is like super fast, but whatever they allow you to push data up to 100 times a minute so im way under.
My house is currently set to 68F, so its interesting to see how accurate my actual house heating thermostat is, as well as to see how often my forced air heater is turning on.





And this is my feed, click on the title to see a better zoomed in version and hover over the graph to see specific data points.
https://cosm.com/feeds/83208

This is all of the code running on the Arduino...
Code:
#include <Cosm.h>
#include <CosmClient.h>
#include <CosmDatastream.h>
#include <CosmFeed.h>
#include <CountingStream.h>

#include <b64.h>
#include <HttpClient.h>

#include <OneWire.h>
#include <DallasTemperature.h>
#include <SPI.h>
#include <Ethernet.h>

//Defines for DS18B20
#define ONE_WIRE_BUS 3
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress Sensor1 = {
0x28, 0xA9, 0x31, 0x98, 0x03, 0x00, 0x00, 0x84};
DeviceAddress Sensor2 = {
0x28, 0xA8, 0xE5, 0x97, 0x03, 0x00, 0x00, 0x68};
//End Defines for DS18B20

//Defines for COSM Ethernet
char cosmKey[] = "INSERT YOUR KEY HERE";
byte mac[] = { 
  0x00, 0x1D, 0x0D, 0x2C, 0x55, 0x3D};

EthernetClient client;
CosmClient cosmclient(client);

//End Defines for COSM Ethernet
double s1 = 0;
double s2 = 0;


#define MYDELAY 1000
char sensor1Id[] = "FermSensor1";
char sensor2Id[] = "Ambient";

CosmDatastream datastreams[] = {
  CosmDatastream(sensor1Id, strlen(sensor1Id), DATASTREAM_FLOAT),
  CosmDatastream(sensor2Id, strlen(sensor2Id), DATASTREAM_FLOAT)};

CosmFeed feed(83208, datastreams, 2);

void setup(void)
{
  // start serial port
  Serial.begin(9600);
  SetupSensors();

  while (Ethernet.begin(mac) != 1)
  {
    Serial.println("Error getting IP address via DHCP, trying again...");
    delay(15000);
  }
}

void SetupSensors()
{
  sensors.begin();
  // set the resolution to 12 bit (good enough?)
  sensors.setResolution(Sensor1, 12);
  sensors.setResolution(Sensor2, 12);
}



float getTemperature(DeviceAddress deviceAddress)
{
  //Get temperature, convert to Fahrenheit, and return
  return DallasTemperature::toFahrenheit(sensors.getTempC(deviceAddress)); 
}

void loop(void)
{
  SensorLoopAndSend();
} 


void SensorLoopAndSend()
{
  sensors.requestTemperatures();
  s1 = getTemperature(Sensor1);
  s2 = getTemperature(Sensor2);
  Serial.print("S1: ");
  Serial.println(s1);
  Serial.print("S2: ");
  Serial.println(s2);
  datastreams[0].setFloat(s1);
  datastreams[1].setFloat(s2);
  int ret = cosmclient.put(feed, cosmKey);
  delay(5000);
}
__________________
HOWTO - Build a BrewPi Fermentation Chamber Cheap

View Current Brew via my BrewPi setup!
FuzzeWuzze is offline
 
Reply With Quote Quick reply to this message
Old 12-06-2012, 07:31 PM   #238
KokomoSam
HBT_SUPPORTER.png
Feedback Score: 0 reviews
Recipes 
 
Join Date: Feb 2012
Location: VillaPark, IL
Posts: 44
Liked 5 Times on 4 Posts
Likes Given: 4

Default

Quote:
Originally Posted by FuzzeWuzze View Post
If your goal is just to see your temps and not actively control anything(like in a fermentation controller) why not just use COSM?
Its free and lets you push data to it to do exactly what your trying to do. http://www.cosm.com

COSM looks pretty cool. However, my end goal is to control temp as well. Monitoring is just step one. Plus, I like having my data locally.

One question, how did you inert your thermowell into your plastic bucket. I haven't done anything like that yet as I am afraid of introducing bad stuff into my beer.

Step one is coming along nicely I have moved from creating a graph statically to dynamically displaying the data using Google API's with some help of a friend.

__________________
KokomoSam is online now
icebrew Likes This 
Reply With Quote Quick reply to this message
Old 12-07-2012, 03:39 AM   #239
bfinleyui
Feedback Score: 0 reviews
Recipes 
 
Join Date: Nov 2012
Posts: 371
Liked 17 Times on 17 Posts
Likes Given: 44

Default

I'm about at the same spot. Currently just using d3 to graph the data, but had completely forgotten about the google APIs. that'll be the next step, but here's a current live view of my ferm temps. As of opsting, only about 3 hours in there as I post this, but it'll show the last 12 hours by default:

http://dev.toastedsocks.com/ferm

__________________
Primary: None
Bottled: Cinnamon Apple Cider, Two Hearted Clone, FW Double Jack Clone
Kegged: House Pale Ale, Russian Imperial Stout, Milk Chocolate Stout/Porter Partigyle, Graff
Conditioning:
On Deck: DIPA w/Heady Topper Yeast, Winter Warmer, Imperial Red
bfinleyui is offline
 
Reply With Quote Quick reply to this message
Old 12-07-2012, 04:19 AM   #240
bikesnbeers
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
Recipes 
 
Join Date: May 2009
Location: Sacramento, CA
Posts: 115
Liked 5 Times on 5 Posts

Default

Quote:
Originally Posted by KokomoSam

Step one is coming along nicely I have moved from creating a graph statically to dynamically displaying the data using Google API's with some help of a friend.
Can you give us some pointers/code for the dynamic display? Im sending temps to a google spreadsheet, but the graphs do not update. Are you deleting old temp entries when adding new ones? Thx!
__________________
bikesnbeers is offline
 
Reply With Quote Quick reply to this message
Reply



Quick Reply
Message:
Options
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Temperature Monitoring and Control with Arduino erock2112 Fermenters 85 04-05-2011 08:46 PM
Controlling Wort Flow capnr0n Brew Stands 12 03-16-2010 05:00 AM
Temperature Controlled Brewcloset with remote monitoring Mista_Sparkle Fermenters 1 11-26-2009 08:53 AM
Monitoring temp on the cheap... tireater Brew Stands 20 04-15-2009 08:06 PM
Basic ambient temperature monitoring jasper9 Fermenters 8 01-01-2009 12:19 AM



Newest Threads

LATEST SPONSOR DEALS