Spike Brewing 12.5 Conical Fermenter Giveaway - Enter Now!

Home Brew Forums > Home Brewing Beer > DIY Projects > Real Time Online Fermentation Temperature Monitor for ~$60

Reply
 
LinkBack Thread Tools
Old 11-30-2012, 03:54 AM   #1
FuzzeWuzze
HBT_SUPPORTER.png
Feedback Score: 0 reviews
 
FuzzeWuzze's Avatar
Recipes 
 
Join Date: Jun 2012
Location: Hillsboro, OR
Posts: 2,102
Liked 223 Times on 169 Posts
Likes Given: 16

Default Real Time Online Fermentation Temperature Monitor for ~$60

Updated Build Info @ http://fuzzelogicbrewing.blogspot.com

So, after making this project i figure i would spend a bit of time documenting the process incase any one else was interested. It uses an Arduino and an ethernet shield to push data to the COSM service which is free, they handle all of the data and graphing for you automatically.

At the end of this project you will have a project that should output the data to COSM and be capable of creating graphs like this real time COSM graph of my Fermentation and Ambient temperatures. COSM is a very powerful tool for free, you can use it to get real time data of your temperatures anywhere you have internet access, and can even set up triggers to tweet/email you when certain things happen. For example i have it setup to email me if my fermentation temperatures ever get less than the yeast im using or too hot, which allows me to fix the problem ASAP. Also side note, it should tweet/email me should my house catch fire and the ambient gets > 110 lol, or if i leave my door open or something and it gets < 50F.

Note: This is REAL time, the image is built by COSM when you request it. The image you are seeing is what my setup is reading as of when you loaded this web page and the image loaded. If you reload the page it will give you a new graph with the updated data. The graphs are currently showing the last 24 hour period.
This is the feed you can also view
https://cosm.com/feeds/83208





Equipment Needed

  • Arduino Uno
  • Wiznet 5100 Ethernet Shield
  • 2 x DS18B20 Temperature Sensors
  • Wire
  • Solder
  • 2 x 4.7K Resistors
  • 5V Power Supply OR SmartPhone USB Wall Charger(come with most smart phones now)

A good place to get the UNO and Wiznet Ethernet shield is DealExtreme, for those not familiar with it, they produce cheap chinese knockoffs off stuff. But because Arduino is an open source project revolving around a single chip, there should be no fear in buying from them. The only downside is it can take upwards of 3-4+ weeks from ordering to get your products in the US. Take that into consideration, you can get the Uno and Wiznet Ethernet shield from other outlets, but at a much higher cost. Some people may be against the idea of supporting Chinese manufacturing, or just dont want to wait over a month to get everything...just make sure you get the Wiznet 5100 and not another Ethernet shield or the code here wont work.

Arduino UNO - $15.20

http://dx.com/p/arduino-uno-rev3-development-board-120464

Wiznet 5100 Ethernet Shield - $13.99

http://dx.com/p/ethernet-shield-with-wiznet-w5100-ethernet-chip-tf-slot-118061

2 x Maxim DS18B20+ Temperature Sensors - ~$4.50 each.
You can find these at sites like Digikey or other electronics stores online, hunt around and you can find them at decent rates. I bought a bundle of 10 off Ebay for $20 dollars.


Wire
I bought some cheap 4 wire flexible thermostat wire from Lowes for 33c/foot. Its nice and thin and will fit down a thermowell but yet remain flexible...you can use any wiring you want as long as it will fit in your thermowell.

Thermowell - $14
You can use any you want, just make sure its not too long to fit into your bucket or carboy but to get a fair ways into your wort when its at the 5G marker.
http://www.brewershardware.com/16-Stainless-Steel-Thermowell.html

2x 4.7k Resistors - Cheap?
The DS18B20's require that you have a 4.7k resistor between the Data and Power pins in order to function.

5V Power supply - $1-2 dollars at any Goodwill/Salvation army, free if you have extra wall warts laying around that are 5V.
Phone charger USB connectors work as well, such as the standard one that comes with the iPhone or the Android versions

The USB connectors allow you to plug right into the USB port of the Arduino to get power. Otherwise for the 5v connector you need to plug in the jack, or cut the supply and solder it directly into the 5V and Ground connections on the Arduino, this allows you to pass their voltage regulator which IMO gets too hot for my liking.

Build

Start by wiring up the DS18B0's to your length of Thermostat or other wiring.

You need to wire your 4.7k resistor across the Data and Gnd pins, i usually do this at the end of the wire that goes into the arduino. A few inches above where im going to be plugging into the Arduino i strip/melt with soldering iron the wire jacket on both wires and solder the resistor between them.
Because the DS18B20's use OneWire, you need to ensure that both of your 'sensor cables' are soldered together in some fashion. The Gnd to Gnd, Power to Power, and Data to data. I found just twisting the two ends together with a third piece of wire(thats going to plug into the Arduino) and soldering them together worked quite well. You could probably even get away with cable twist connectors if your wire gauge is thick enough. Once you have the cables with sensors on them, its a good idea to somehow protect the DS18B20 leads so they dont touch. I found using a bit of hot glue works great, not to mention if you coat the sensor itself in a small layer of hot glue you can essentially make it water proof. Just dont put so much on you cant get it into your thermowell!

Install the Arduino development software off of their site, and connect your arduino via the supplied USB cable to your computer and make sure it all gets detected and installed properly.

Hook your probe(s) up as follows to the Arduino
DS18B20 - Arduino
Data(Pin 2) - Digital Pin 3
Power(Pin 3) - 5V
Ground(Pin 1) - GND

Now close the Arduino software and download the Onewire Library here
http://www.hacktronics.com/code/OneWire.zip
And the DallasTemperature Library
http://www.hacktronics.com/code/DallasTemperature.zip
And the COSM Client
https://github.com/cosm/cosm-arduino/archive/master.zip

Extract these into the Arduino/Libraries folder..so you should have a Arduino/Libraries/OneWire, etc.

Next open the arduino software, in the settings make sure you set the Serial port the Uno USB drivers installed onto(Check device manager) and the device type to the Arduino UNO.

Copy and paste this code into the window
Code:
// This sketch looks for 1-wire devices and
// prints their addresses (serial number) to
// the UART, in a format that is useful in Arduino sketches
// Tutorial: 
// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html

#include <OneWire.h>

OneWire  ds(3);  // Connect your 1-wire device to pin 3

void setup(void) {
  Serial.begin(9600);
  discoverOneWireDevices();
}

void discoverOneWireDevices(void) {
  byte i;
  byte present = 0;
  byte data[12];
  byte addr[8];
  
  Serial.print("Looking for 1-Wire devices...\n\r");
  while(ds.search(addr)) {
    Serial.print("\n\rFound \'1-Wire\' device with address:\n\r");
    for( i = 0; i < 8; i++) {
      Serial.print("0x");
      if (addr[i] < 16) {
        Serial.print('0');
      }
      Serial.print(addr[i], HEX);
      if (i < 7) {
        Serial.print(", ");
      }
    }
    if ( OneWire::crc8( addr, 7) != addr[7]) {
        Serial.print("CRC is not valid!\n");
        return;
    }
  }
  Serial.print("\n\r\n\rThat's it.\r\n");
  ds.reset_search();
  return;
}

void loop(void) {
  // nothing to see here
}
Save it, and wth your Arduino all plugged in with sensors and lit up, hit upload and make sure that it gets uploaded properly with no compile errors.

When it is complete, from the dropdown menu in the Arduino software select the Serial Monitor option. A new window will pop up and within a second or two it should print some text containing the Address's for any Sensors that are plugged in. If it pops up and shows no addresses, your sensors are not plugged in properly. Ensure all connections on both sides are right, use a Multimeter to help debug if you have one. Because the DS18B20's leads are so small it can be a pain to get them soldered without briding between leads.

Write down the addresses it gives you, these are the addresses you need to use in the later program for it to address your sensors on the onewire bus.

Next create a new program in arduino, and paste in this
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[] = "ENTER YOUR COSM 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 5000
char sensor1Id[] = "FermSensor1";
char sensor2Id[] = "Ambient";

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

CosmFeed feed(<INSERT FEED ID HERE>, 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 10 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(MYDELAY);
}
I think the code is pretty easy to read and straight forward
First replace your Device Addresses with the ones i have in my code, you can add more sensors if you wish as well.
Next make an account on COSM and when logged on COSM create a Feed, in your Keys section(top right) you should be given an API Key, place that in the COSMKey variable
Next i dont think its necessary but not a bad idea, when the ethernet plugged into the arduino and linked, log into your router and find the mac address of your Wiznet module. It should be fine to use my MAC address, but using your own wouldnt hurt if you knew how.
Next name your Sensors, mine are just Ambient and FermSensor1, these names will be pushed to COSM automatically with your data so you dont need to make them within the COSM webpage. Dont use spaces, and some special characters might not work so stick to basic
Finally on this line
CosmFeed feed(<INSERT FEED HERE>, datastreams, 2);
Replace your Feed Number, and the last number is how many feeds you are pushing. So if you are using more than 2 sensors increase this number.

That should be everything! Save it and upload it and make sure it compiles, fix any errors you have or ask here if you have no clue what your doing.

You can check the Serial Monitor to see if its reading your probes properly, if it is you should be seeing data on your COSM feed!
If you are not seeing data, use the Debug area(Top right menu) on COSM. It will show you how many requests they are getting from you. By default this code should have about 20 updates per minute which is well under their maximum of 100. 5 Seconds is already way fast for updates

Thats it! Feel free to post questions here if you have any ill do my best to help!

Last edited by TxBrew; 02-19-2013 at 12:31 PM.
FuzzeWuzze is offline
5
People Like This 
Reply With Quote Quick reply to this message
Old 11-30-2012, 04:47 AM   #2
slatorian
Feedback Score: 0 reviews
Recipes 
 
Join Date: May 2011
Location: Baltimore, MD
Posts: 40
Default

I'll sub, this is something I've been looking to do since I already have an UNO sitting around. I look forward to seeing the rest of the build

__________________

Planning: -a spring beer
-Beached Whale IPA
-a lager
In Primary:
Bottled: -Bombshell Blonde
-dark amber
-hefeweizen

Go Hokies!

slatorian is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 12:36 PM   #3
starman
Feedback Score: 0 reviews
Recipes 
 
Join Date: Oct 2011
Location: Chicago Burbs, il
Posts: 460
Liked 20 Times on 17 Posts
Likes Given: 35

Default

Subscribed. Thanks for the write up. This looks doable for a welterweight tech person like me.

Can this support multiple zones easily?

Are you controlling temps with a relay and the arduino too?

__________________
starman is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 02:05 PM   #4
Matt3989
HBT_SUPPORTER.png
Feedback Score: 0 reviews
Recipes 
 
Join Date: Aug 2012
Posts: 453
Liked 43 Times on 38 Posts
Likes Given: 3

Default

subscribed. I was looking for exactly this a month ago, someone gave me something similar that i was going to build soon, but this is perfect.

__________________
Matt3989 is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 04:04 PM   #5
brans041
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jul 2012
Posts: 60
Liked 1 Times on 1 Posts

Default

Nice. Many of these are out there. I like it.

__________________
brans041 is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 04:23 PM   #6
Psych
Feedback Score: 0 reviews
Recipes 
 
Join Date: Mar 2011
Location: Kelowna, BC
Posts: 761
Liked 30 Times on 28 Posts
Likes Given: 30

Default

Subscribed, definitely of interest!

Psych is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 08:00 PM   #7
jimmayhugh
Turgid Member
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
jimmayhugh's Avatar
Recipes 
 
Join Date: Feb 2011
Location: Las Vegas, NV
Posts: 579
Liked 46 Times on 41 Posts
Likes Given: 2

Default

Might want to look here. I've done most of the work, including the COSM, and a little more.

__________________
TeensyNet Networked Controller
ButtCrack Brewery
And This Is Why We Drink...
jimmayhugh is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 08:02 PM   #8
andycr
Feedback Score: 0 reviews
Recipes 
 
Join Date: Aug 2012
Posts: 307
Liked 40 Times on 35 Posts
Likes Given: 20

Default

I've been thinking about doing exactly this lately, great writeup!

__________________
Primary: Wayward Pines Pale Ale
Kegged: Black Pearl Porter
Bottled: The Sunken Norwegian, Cream Ale, Murphy's Law, Waystone Inn Ale
Next up: Murphy's Law
andycr is offline
 
Reply With Quote Quick reply to this message
Old 11-30-2012, 09:57 PM   #9
FuzzeWuzze
HBT_SUPPORTER.png
Feedback Score: 0 reviews
 
FuzzeWuzze's Avatar
Recipes 
 
Join Date: Jun 2012
Location: Hillsboro, OR
Posts: 2,102
Liked 223 Times on 169 Posts
Likes Given: 16

Default

Quote:
Originally Posted by jimmayhugh View Post
Might want to look here. I've done most of the work, including the COSM, and a little more.
it's your post that inspired this :-) but I was looking for the bare minimum to do it to just see temperatures and not have to host my own webserver and have to worry about maintaining that whole thing :-) after years of hosting game servers, I'm a bit tired of the extra work, so I let cosm do it for me.

I'm out this weekend,so won't have time to finish this until Monday :-) while writing it I realized there was still a lot to explain :-)
__________________
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-01-2012, 02:18 AM   #10
slakwhere
Feedback Score: 1 reviews
Recipes 
 
Join Date: Dec 2009
Location: Salt Lake City, Utah
Posts: 755
Liked 19 Times on 18 Posts
Likes Given: 9

Default

COSM looks tasty. i may have to follow up on this as well

__________________
slakwhere 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
Interesting Temperature Monitor with SMS Jeepninja DIY Projects 3 12-07-2011 05:59 PM
USB Temperature monitor brehuh Brewing Software 6 05-26-2011 03:03 PM
1-Wire Temperature Monitor Vinic DIY Projects 12 01-12-2010 06:01 PM
Temperature Monitor N5629 DIY Projects 5 03-31-2009 04:54 PM
Real-Time Fermentation Monitor Yorbag Equipment/Sanitation 90 11-14-2008 03:19 PM