Real Time Online Fermentation Temperature Monitor for ~$60

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.

That's just another step that not everyone needs to or wants to take which is why i made this project. This is more for complete DIY computer retards, start telling computer illiterate people about SQL Database's and HTML code and they will cry ;)

If i wanted to go that far i'd look at something like your project or BrewPi. For me atleast, me storing my own data does me no good unless i plan to actually do something based on the data, like control SSR's.

I updated using their Xively API and its working again, they just changed all the api calls from Cosmclient to Xivelyclient, etc...annoying but only took me 30 mins to fix.

Just a bit pissed that going from COSM as a "Beta" to Xively as a "release" it now has less features. How the hell is that even possible from a software company where the release has less features than the beta lol...ugh. I'd get fired for that for software at work lol.
 
Ya, to do anything, it forced me to more or less create a new feed. So I went ahead, and tore through my python script on my pi. Updated the API address to API.xively everywhere, and updated my new API key and feed number. Then on my blog updated the jscript to pull from the new Xively API with the new key and feed number.

The annoying thing is, the custom graph feature is completely gone. The old API still works, but oddly enough, you have to remove the time zone setting from the URL for it to graph any data.

So I have graphs again (YAY!!), but the time on my graphs isn't accurate (oh well).
 
I already emailed their support with a feature request to re-enable the custom graphs that you could get URL's to for embedding.

I highly suggest you do the same, if we can get multiple people all telling them how retarded they are for removing it they may speed up.
They replied that they noticed a few bugs and omissions and are working on them, but more people complaining may help them prioritize..

I also requested that they add the ability to plot two graphs on the same graph. It would be great if i could just get both Ambient and Fermentation on a single graph since they have the same time deltas and units.
 
That's just another step that not everyone needs to or wants to take which is why i made this project. This is more for complete DIY computer retards, start telling computer illiterate people about SQL Database's and HTML code and they will cry ;)

I have already incorporated all of the code and database access into my software. I've tried to make the system as easy as possible to get started, including boards, so you can start as small or big as you want.

I've got a few folks that are "DIY computer retards" that have gotten the system up and running. :D
 
I've followed a tutorial on setting up the RPi (by Scottland, i think) and it's working fine except the script stops running after as few as 4 hours and no more than 12 h. I have it streaming data to Xively (formally COSM). Any additional code I can include to the script that will resolve this? thanks
 
Thats one reason i opted not to use a RPI much like many others have found it can crash a lot.

That said, it should be pretty trivial to set up a startup service that checks if the script is running every X minutes, if its not, it starts it. That way if the RPI crashes when it comes back up it should start again.
 
Thats one reason i opted not to use a RPI much like many others have found it can crash a lot.

I made my own distro using the Moebius release, and it's as solid as a rock. My TeensyPi has been chugging along for almost a month now:
graph.png
 
I have a question for this kind of build. What size board would be needed if I want to do 5 temp probes. I want to do 1 ambient and then 4 fermenters. Thanks in advance.
 
Well i have since moved away from this method, because the API changed and it was a bit of a pain...but in theory this should still work with the new Xively service.

If you mean what Arduino you just need an Uno, all of the sensors are wired to the same pin and are addressed by their internal address using the OneWire protocol.
 
FuzzeWuzze is correct. One pin on the Arduino Uno will support 5 DS18B20's no problem captrichc.
 
Ok. Thanks ks for the update. Now I need to source all the parts and the codes. I can solder and such but never actually done anything like this before. Is there a new updated parts list I should be getting to do this temp set up? Thanks again.
 
The parts are the same, although now adays you can get an Arduino Uno from Sainsmart for 18 bucks off Amazon so you dont have to wait forever from China.
You can also find the Wiznet W5100 on Amazon for the same price or maybe a few dollars more than DX.com
And you can get 10x of the DS18B20 sensors for $13, its nice to have extra's around anyways.

http://www.amazon.com/dp/B00E5WJSHK/?tag=skimlinks_replacement-20
http://www.amazon.com/dp/B00CRX7BI2/?tag=skimlinks_replacement-20
http://www.amazon.com/dp/B007STHA22/?tag=skimlinks_replacement-20
 
Last edited by a moderator:
Ok. So these still get wired with a 4.5 or a 4.7k resistor correct. Also does each sensor get the resistor? Or is 1 resistor for all of the runs since they all go to one spot..
 
Great. Thanks. One last question. Will the coding work from the original postings.

Not really... Kinda...

everything was changed from cosm to Xively - Here's my code.

Code:
#include <Xively.h>
#include <XivelyClient.h>
#include <XivelyDatastream.h>
#include <XivelyFeed.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, 0x82, 0x03, 0x55, 0x05, 0x00, 0x00, 0xB8};
DeviceAddress Sensor2 = {0x28, 0x82, 0x03, 0x55, 0x05, 0x00, 0x00, 0xB8};
//End Defines for DS18B20

//Defines for Xively Ethernet
char xivelyKey[] = "YKTsQhH5n2bt9AXyPpFQ123gfd7jH0jTccxmAds6AvAr7aBc";
byte mac[] = { 
  0x00, 0x1D, 0x0D, 0x2C, 0x55, 0x3D};

EthernetClient client;
XivelyClient Xivelyclient(client);

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


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

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

XivelyFeed feed(633693457, 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);
  if((s1 != 185) && (s2 != 185) && (s1 != 32) &&  (s2 != 32))
  {
    datastreams[0].setFloat(s1);
    datastreams[1].setFloat(s2);
    int ret = Xivelyclient.put(feed, xivelyKey);
  }
  delay(MYDELAY);
}

I did get it to work https://xively.com/feeds/633693074
 
Hi all,

This thread has morphed a bit since it started.

For anyone new to the thread there is a conflict in the OP re. the parasitic power connctions:

In the shopping list:
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.

Further down it says:
You need to wire your 4.7k resistor across the Data and Gnd pins

This took a while to spot as I took the later approach.

Ok so things now readable. Got the addresses plugged into the origianl code (but minus the ethernet bits - just want the serial output)


Worked fine but in Fahrenheit!

Changed to Centigrade and just get 85C on all sensors.
This is the power on default.

Played with various calls. No joy so back to Farhenheit - all 3 are now stuck at 185F

Any one have these sorts of problems.

BTW: I know for a 12 bit conversion there need to be a 750mSecond delay. Where is this implemented? In the Dallas code maybe?

Time for a pint for me - the head is wrecked.

Cheers

Will
 
You only need one resistor, I thought you needed two when i first started the project.

Ive had these problems with the DS18B20's, which is why i started buying premade ones ;)

You have no idea how many times i got 185F or 32F which is also an errored state....all i can recommend is to check your solder connections on both ends. And when you do finally get a sensor working, cover the leads in some aquarium silicone. I found most of mine ended up breaking because the pins shorted together.
 
I am afraid these are the pre-made ones with fitted headers so soldering is not it.

Got one channel to read in F Ok. Back to C got 85C Back to F got 185 F just from recompiling and changing a F to a C and back to F in the procedure names!.

This so weird!
 
First off, thanks to everyone for the intro to this project. I like keeping local hardwire control in my STC-1000+ and monitoring via the web. After much work (not a coder), I ended up with Exosite. Tried Xively (long wait), and ATTM2X (didn't work for me). Exosite works great, easy to use with copy/paste code and widgets. Up and running at http://bit.ly/1xc9o4H if you'd like to check it out. The Exocite code is here: http://bit.ly/1yampKp. Cheers!
 
The logical next question...so, it compiles, but I haven't tried it yet. See below:

Assumption (add)
- User has added two dataports on Exosite with the aliases "temp1" and "temp2" (http://forum.arduino.cc/index.php?topic=271931.0)

Hardware (add)
- 2nd Dallas Semiconductor DS18B20 1-Wire Temp sensor attached to each leg after 4.7k pull-up

Code:
#include <EEPROM.h>
#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Exosite.h>

// Pin use
#define ONEWIRE 7 //pin to use for One Wire interface

// Set up which Arduino pin will be used for the 1-wire interface to the sensor
OneWire oneWire(ONEWIRE);
DallasTemperature sensors(&oneWire);

/*==============================================================================
* Configuration Variables
*
* Change these variables to your own settings.
*=============================================================================*/
String cikData = "YOURCIKHERE";  // <-- FILL IN YOUR CIK HERE! (https://portals.exosite.com -> Add Device)
byte macData[] = {YOURMACADDRESSHERE};        // <-- FILL IN YOUR Ethernet shield's MAC address here.
IPAddress ip(YOURIPADDRESSHERE);
// User defined variables for Exosite reporting period and averaging samples
#define REPORT_TIMEOUT 30000 //milliseconds period for reporting to Exosite.com
#define SENSOR_READ_TIMEOUT 5000 //milliseconds period for reading sensors in loop


/*==============================================================================
* End of Configuration Variables
*=============================================================================*/

class EthernetClient client;
Exosite exosite(cikData, &client);

//
// The 'setup()' function is the first function that runs on the Arduino.
// It runs completely and when complete jumps to 'loop()' 
//
void setup() {
  Serial.begin(9600);
  Serial.println("Boot");
  // Start up the OneWire Sensors library
  sensors.begin();
  delay(1000);
  Serial.println("Starting Exosite Temp Monitor");
  Serial.print("OneWire Digital Pin Specified: ");
  Serial.println(ONEWIRE);
  Ethernet.begin(macData);
  // wait 3 seconds for connection
  delay(3000); 

}

//
// The 'loop()' function is the 'main' function for Arduino 
// and is essentially a constant while loop. 
//
void loop() {
  static unsigned long sendPrevTime = 0;
  static unsigned long sensorPrevTime = 0; 
  static float temp1F;
  static float temp2F;
  char buffer[7];
  String readParam = "";
  String writeParam = "";
  String returnString = "";  
   
  Serial.print("."); // print to show running

// Read sensor every defined timeout period
  if (millis() - sensorPrevTime > SENSOR_READ_TIMEOUT) {
    Serial.println();
    Serial.println("Requesting temperature...");
    sensors.requestTemperatures(); // Send the command to get temperatures
    float temp1C = sensors.getTempCByIndex(0);
    Serial.print("Celsius:    ");
    Serial.print(temp1C);
    Serial.println(" C ..........DONE");
    temp1F = DallasTemperature::toFahrenheit(temp1C);
    Serial.print("Fahrenheit: ");
    Serial.print(temp1F);
    Serial.println(" F ..........DONE");
    
    sensors.requestTemperatures(); // Send the command to get temperatures
    float temp2C = sensors.getTempCByIndex(1);
    Serial.print("Celsius:    ");
    Serial.print(temp2C);
    Serial.println(" C ..........DONE");
    temp2F = DallasTemperature::toFahrenheit(temp2C);
    Serial.print("Fahrenheit: ");
    Serial.print(temp2F);
    Serial.println(" F ..........DONE");
     
    sensorPrevTime = millis();
  }

  // Send to Exosite every defined timeout period
  if (millis() - sendPrevTime > REPORT_TIMEOUT) {
    Serial.println(); //start fresh debug line
    Serial.println("Sending data to Exosite...");
    
    readParam = "";        //nothing to read back at this time e.g. 'control&status' if you wanted to read those data sources
    writeParam = "temp1="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    String tempValue = dtostrf(temp1F, 1, 2, buffer); // convert float to String, minimum size = 1, decimal places = 2
    
    writeParam += tempValue;    //add converted temperature String value
    
    writeParam += "&temp2="; //parameters to write e.g. 'temp=65.54' or 'temp=65.54&status=on'
    
    tempValue = dtostrf(temp2F, 1, 2, buffer); 
    
    writeParam += tempValue;    //add converted temperature String value
    
    //writeParam += "&message=hello"; //add another piece of data to send

    if ( exosite.writeRead(writeParam, readParam, returnString)) {
      Serial.println("Exosite OK");
      if (returnString != "") {
        Serial.println("Response:");
        Serial.println(returnString);
      }
    }
    else {
      Serial.println("Exosite Error");
    }

    sendPrevTime = millis(); //reset report period timer
    Serial.println("done sending.");
  }
  delay(1000); //slow down loop
}
 
Back
Top