Real Time Online Fermentation Temperature Monitor for ~$60 - Home Brew Forums
Register Now For Free!

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

Thread Tools
Old 11-30-2012, 04:54 AM   #1
I Love DIY
FuzzeWuzze's Avatar
Jun 2012
Newberg, Oregon
Posts: 3,131
Liked 437 Times on 320 Posts

Updated Build Info @

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

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

Wiznet 5100 Ethernet Shield - $13.99

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.

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 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.

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.


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
And the DallasTemperature Library
And the COSM Client

Extract these into the Arduino/Libraries 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
// 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: 

#include <OneWire.h>

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

void setup(void) {

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

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
#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

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

void SetupSensors()
  // 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)

void SensorLoopAndSend()
  s1 = getTemperature(Sensor1);
  s2 = getTemperature(Sensor2);
  Serial.print("S1: ");
  Serial.print("S2: ");
  int ret = cosmclient.put(feed, cosmKey);
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!

People Like This 
Reply With Quote
Old 11-30-2012, 05:47 AM   #2
May 2011
Baltimore, MD
Posts: 40

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

Go Hokies!

Reply With Quote
Old 11-30-2012, 01:36 PM   #3
starman's Avatar
Oct 2011
Chicago Burbs, il
Posts: 460
Liked 23 Times on 17 Posts

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?

Reply With Quote
Old 11-30-2012, 03:05 PM   #4
Aug 2012
Posts: 449
Liked 48 Times on 39 Posts

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.

Reply With Quote
Old 11-30-2012, 05:04 PM   #5
Jul 2012
Posts: 60
Liked 1 Times on 1 Posts

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

Reply With Quote
Old 11-30-2012, 05:23 PM   #6
Psych's Avatar
Mar 2011
Kelowna, BC
Posts: 780
Liked 37 Times on 34 Posts

Subscribed, definitely of interest!

Reply With Quote
Old 11-30-2012, 09:00 PM   #7
Turgid Member
jimmayhugh's Avatar
Feb 2011
Las Vegas, NV
Posts: 830
Liked 127 Times on 95 Posts

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...
Cogito, ergo bibere cervisia sum

Reply With Quote
Old 11-30-2012, 09:02 PM   #8
Aug 2012
Posts: 307
Liked 45 Times on 37 Posts

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

Reply With Quote
Old 11-30-2012, 10:57 PM   #9
I Love DIY
FuzzeWuzze's Avatar
Jun 2012
Newberg, Oregon
Posts: 3,131
Liked 437 Times on 320 Posts

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 :-)

Reply With Quote
Old 12-01-2012, 03:18 AM   #10
slakwhere's Avatar
Dec 2009
Salt Lake City, Utah
Posts: 764
Liked 21 Times on 20 Posts

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

Reply With Quote
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Temperature monitor brehuh Brewing Software 6 05-26-2011 03:03 PM
1-Wire Temperature Monitor Vinic Fermenters 12 01-12-2010 07:01 PM
Temperature Monitor N5629 Brew Stands 5 03-31-2009 04:54 PM
Real-Time Fermentation Monitor Yorbag Equipment/Sanitation 90 11-14-2008 04:19 PM

Forum Jump