Author Topic: roaster control widget  (Read 68723 times)

ira

  • Guest
Re: roaster control widget
« Reply #15 on: January 10, 2009, 06:35:40 PM »
Where do you get $4 SSRs?

Ira

Offline mp

  • Standard User
  • *****
  • Posts: 16800
  • Nothing like a nice shot!
Re: roaster control widget
« Reply #16 on: January 10, 2009, 11:19:26 PM »
Ira

I'm going to use an AD595 ($11) and thermocouple ($10) to get the temp.  There is a fair amount of code written for the AD595 for the Arduino so it should be easy to breadboard and test.  I'm hoping to start reading temp next week on my current Sonofresco and start seeing how they really programmed the ramp... once I get an idea of how they control the heat now... then it's just developing a few heat control subroutines, a little re-wire and I should have it...

BTW I'm using som solid state relays ($4 ea) for the blower and  the heater.... simple... one could always add another relay for the drum motor if the roaster has one...

I will keep folks updated on the progress.

Hey Milo .... I'm trying to follow along with you ... if you don't mind me inquiring ... where is the code you are using for the AD595?

Thanks

 :)
1-Cnter, 2-Bean, 3-Skin, 4-Parchmnt, 5-Pect, 6-Pu
lp, 7-Ski

milowebailey

  • Guest
Re: roaster control widget
« Reply #17 on: January 11, 2009, 08:52:01 AM »
Where do you get $4 SSRs?

Ira
They are 2 amp contacts... 5 volt control - Digikey - Z912-ND

milowebailey

  • Guest
Re: roaster control widget
« Reply #18 on: January 11, 2009, 09:03:39 AM »
Ira

I'm going to use an AD595 ($11) and thermocouple ($10) to get the temp.  There is a fair amount of code written for the AD595 for the Arduino so it should be easy to breadboard and test.  I'm hoping to start reading temp next week on my current Sonofresco and start seeing how they really programmed the ramp... once I get an idea of how they control the heat now... then it's just developing a few heat control subroutines, a little re-wire and I should have it...

BTW I'm using som solid state relays ($4 ea) for the blower and  the heater.... simple... one could always add another relay for the drum motor if the roaster has one...

I will keep folks updated on the progress.

Hey Milo .... I'm trying to follow along with you ... if you don't mind me inquiring ... where is the code you are using for the AD595?

Thanks

 :)
MP

I'm not far enough along to start coding yet.... but here is the code to read the temp using the AD595 and thermocouple.

// Define which analog input pin we have connected to the temperature sensor
#define TEMP_SENSOR_PIN 0

// if you tie the Arduino's vRef to the 3.3 volt supply, change this to 3.3
#define ANALOG_VOTLAGE_REFERENCE 5

void setup() {
Serial.begin(115200);
}

void loop() {
// prints the currrent temperature with 1 place after the decimal point
printFloat(getTemperature(), 1);
// print a carriage return
Serial.println();
// rest 100 milliseconds
delay(100);
}

float CtoF(float c) {
// optionally convert from Celsius to Farenheit if you are into that sorta thing
return c * 9.0 / 5.0 + 32.0;
}

float analogInToDegreesC(int inputValue) {
// divide by 1023, the maximum possible input value, that scales the input between 0 - 1
// then multiply by the reference voltage, which scales 0-1 to 0-vREF (default is 5V)
// lastly, multiply by 100 to scale it to 10s of millivolts or degrees
return inputValue / 1023.0 * ANALOG_VOTLAGE_REFERENCE * 100.0;
}
float getTemperature() {
// read the analog input, convert to degrees C, and covert to F
return CtoF(analogInToDegreesC(analogRead(TEMP_SENSOR_PIN)));
}

// ---- This last function, printFloat isn't necessary to understand unless you want to
// ---- feel free to ignore it for now, and treat it as a built-in utility,
// ---- it prints out floating point point values

// printFloat prints out the float 'value' rounded to 'places' places after the decimal point
void printFloat(float value, int places) {
// this is used to cast digits
int digit;
float tens = 0.1;
int tenscount = 0;
int i;
float tempfloat = value;

// make sure we round properly. this could use pow from <math.h>, but doesn't seem worth the import
// if this rounding step isn't here, the value 54.321 prints as 54.3209

// calculate rounding term d: 0.5/pow(10,places)
float d = 0.5;
if (value < 0)
d *= -1.0;
// divide by ten for each decimal place
for (i = 0; i < places; i++)
d/= 10.0;
// this small addition, combined with truncation will round our values properly
tempfloat += d;

// first get value tens to be the large power of ten less than value
// tenscount isn't necessary but it would be useful if you wanted to know after this how many chars the number will take

if (value < 0)
tempfloat *= -1.0;
while ((tens * 10.0) <= tempfloat) {
tens *= 10.0;
tenscount += 1;
}

// write out the negative if needed
if (value < 0)
Serial.print('-');

if (tenscount == 0)
Serial.print(0, DEC);

for (i=0; i< tenscount; i++) {
digit = (int) (tempfloat/tens);
Serial.print(digit, DEC);
tempfloat = tempfloat - ((float)digit * tens);
tens /= 10.0;
}

// if no places after decimal, stop now and return
if (places <= 0)
return;

// otherwise, write the point and continue on
Serial.print('.');

// now write out each decimal place by shifting digits one by one into the ones place and writing the truncated value
for (i = 0; i < places; i++) {
tempfloat *= 10.0;
digit = (int) tempfloat;
Serial.print(digit,DEC);
// once written, subtract off that digit
tempfloat = tempfloat - (float) digit;
}
}
« Last Edit: January 11, 2009, 06:44:58 PM by milowebailey »

Offline staylor

  • Standard User
  • *****
  • Posts: 6403
  • Back in Canada and the espresso still tastes good.
Re: roaster control widget
« Reply #19 on: January 11, 2009, 04:06:57 PM »
Hang on a sec, what was that part again where you mentioned something about // Define... ? I sort of got lost right around there.

Offline grinderz

  • Standard User
  • *****
  • Posts: 3442
  • No unjacked threads!
Re: roaster control widget
« Reply #20 on: January 11, 2009, 04:44:56 PM »
Don't you think Java would be a much more appropriate language around here?

(Programming jokes really are the dumbest)

There are 10 types of people in the world: those who understand binary, and those who don't
var elvisLives = Math.PI > 4 ? "Yep" : "Nope";

milowebailey

  • Guest
Re: roaster control widget
« Reply #21 on: January 11, 2009, 06:42:05 PM »
Don't you think Java would be a much more appropriate language around here?

(Programming jokes really are the dumbest)

There are 10 types of people in the world: those who understand binary, and those who don't

I "C" your point... maybe Java would be better.....
« Last Edit: January 12, 2009, 06:09:58 AM by milowebailey »

Offline peter

  • The Warden - Now Retired
  • Retired Old Goats
  • **
  • Posts: 14524
  • Monkey Club Cupper
Re: roaster control widget
« Reply #22 on: January 11, 2009, 08:09:04 PM »
There are 10 types of people in the world: those who understand binary, and those who don't

As much as I don't know anything about programming, that made me laugh out loud.
Quote of the Day; \"...yet you refuse to come to Me that you

Offline grinderz

  • Standard User
  • *****
  • Posts: 3442
  • No unjacked threads!
Re: roaster control widget
« Reply #23 on: January 11, 2009, 08:59:05 PM »
Don't you think Java would be a much more appropriate language around here?

(Programming jokes really are the dumbest)

There are 10 types of people in the world: those who understand binary, and those who don't

I "C" your point... mayby Java would be better.....

Though without "C" a lot of us would be programing in ASIC and OBOL   ::)
var elvisLives = Math.PI > 4 ? "Yep" : "Nope";

milowebailey

  • Guest
Re: roaster control widget
« Reply #24 on: January 12, 2009, 06:14:18 AM »
Ok, back to topic...

Joe, Dante, and any other Sonofresco users

If you could change the Sonofresco roasting controller what would you change?  I have my ideas, but I'm curious of your ideas.

crholliday

  • Guest
Re: roaster control widget
« Reply #25 on: January 12, 2009, 06:44:35 AM »
Though without "C" a lot of us would be programing in ASIC and OBOL   ::)

ASIC?

There must be some reverse_ninja_entendre_metaphorical_programmer_thing going on here?

Offline grinderz

  • Standard User
  • *****
  • Posts: 3442
  • No unjacked threads!
Re: roaster control widget
« Reply #26 on: January 12, 2009, 08:31:53 AM »
Nah, just me screwing up the punchline. I could never tell a joke and I shouldn't even try sometimes.
var elvisLives = Math.PI > 4 ? "Yep" : "Nope";

milowebailey

  • Guest
Re: roaster control widget
« Reply #27 on: January 12, 2009, 08:39:02 AM »
Nah, just me screwing up the punchline. I could never tell a joke and I shouldn't even try sometimes.
LOL

I think you meant.." Basi or obal"

Offline mp

  • Standard User
  • *****
  • Posts: 16800
  • Nothing like a nice shot!
Re: roaster control widget
« Reply #28 on: January 12, 2009, 09:56:10 AM »
I'm going to use an AD595 ($11) and thermocouple ($10) to get the temp. 


Hey Milo ... I am curious ... have you considered the AD494CQ ... it has +- 1 degree accuracy vs the AD595AQ has +- 3 degree?

"The trick with these thermocouples is that you need a thermocouple amplifier to translate their output into a voltage that is linearly correlated to temperature. This makes it very easy to interface to the Arduino. Enter the AD595. The AD595AQ has a +-3 degree accuracy and is available at Sparkfun ($17.95). The AD494CQ has +- 1 degree accuracy and is available from Digikey. Digikey also has both versions in ROHS (lead free package) versions for 10 - 20 bucks more each if you would like. These are 14 pin DIP (will fit in a breadboard) packages. Even though they are 14 pins, you can breadboard one without a lot of effort."

Full Reference Link
1-Cnter, 2-Bean, 3-Skin, 4-Parchmnt, 5-Pect, 6-Pu
lp, 7-Ski

milowebailey

  • Guest
Re: roaster control widget
« Reply #29 on: January 12, 2009, 10:52:37 AM »
I'm going to use an AD595 ($11) and thermocouple ($10) to get the temp. 


Hey Milo ... I am curious ... have you considered the AD494CQ ... it has +- 1 degree accuracy vs the AD595AQ has +- 3 degree?

"The trick with these thermocouples is that you need a thermocouple amplifier to translate their output into a voltage that is linearly correlated to temperature. This makes it very easy to interface to the Arduino. Enter the AD595. The AD595AQ has a +-3 degree accuracy and is available at Sparkfun ($17.95). The AD494CQ has +- 1 degree accuracy and is available from Digikey. Digikey also has both versions in ROHS (lead free package) versions for 10 - 20 bucks more each if you would like. These are 14 pin DIP (will fit in a breadboard) packages. Even though they are 14 pins, you can breadboard one without a lot of effort."

Full Reference Link

Good point... I should have looked at the datasheet closer.... I ordered the AD595AQ's... I can always change to the AD595CQ's later... same pinout.