Problems with a thermocouple

I am having trouble with a simple setup to test my Type K thermocouple and AD595 amplifier.

With my voltmeter I am reading a +/-10uV fluctuations due to temperature plus a reading of 270mV which according to the tables is around 27 C. The AD595 and thermocouple are operating as they should.

I have tried a few different setups on the arduino end:

1.) Analog input with no external voltage reference tied to AREF.
2.) Analog input with external voltage (5.54V) to AREF.
I followed the reference usage directions:

  • Defined my analogReference(EXTERNAL);
  • Included: #define ANALOG_VOTLAGE_REFERENCE 5.5
    3.) In either case I get similar results:

Either the readout on the serial monitor is 0.00 with the reference tied in, or it cycles wildly through up to 1023 and then back to zero.

What I am not understanding is how I can read the correct values at the analog input terminal but even when I just print the raw serial data using Serial.Print(analogRead(0)); I get either zero or wild cycling. Shouldn't I see 270 or so if I just printed the raw AI value?????

Here is the example test sketch PLEASE HELP I'm drowing over here, and I know I am missing something really simple.

Quote:
float myVal;
//#define ANALOG_VOTLAGE_REFERENCE 5.5

void setup()
{
// analogReference(EXTERNAL);
Serial.begin(9600);

}

void loop()
{
myVal = analogRead(2);
Serial.print(myVal);
// Serial.println((5.54 * myVal) /1024);// just change 5 to 4.87
delay(1000);
}

:-/

Thanks I'll take your advice, isn't the internal reference voltage for a 328 1.1 or so, would I even need to add anything to the sketch to take advantage of this?

Thanks!

Hopefully this thread isn't dead, I'm going to be using the AD595 with a type K thermocouple for a kiln controller.

so far I'm just trying to get a value to show on an LCD that is the analog value converted to degrees F

the AD595 puts out a linear 0 - 5v for the input from the thermocouple. that said, I plan to use a pot for test purposes, the formula for converting the voltage to degrees F is as follows.

Temp(F) = (355.2823 * Volts) - 16.7674

now I need to convert the analog input from 0-1023 back to volts

so I'm figuring I'll be dividing 5 by 1024 giving me an akward decimal for the constant

in other words I'll be multipyling the input value 0-1023 by 5/1024

multiplying that by 355.2823

and subtracting 16.7674

to render the temperature in degrees F

that's where it gets hazy for me

for one thing I don't see any reason to include the entire math library if I'm only going to be using a single function, and I'm not even sure that is in there. I see other examples where they do use math.h but memory is going to be precious in this application so I'm looking to keep it as lean as possible.

can I just define a constant as the fraction 5/1024

the following is what I have with some things I know to be incorrect such as how to define the constant and the math function converting the volts to the temperature value in degrees F

I also know I could simplify it by multiplying 5*355.2823 and dividing that by 1024 (giving me 1.7348 for the constant - constVolt in the example below) then I only need to multiply it by the sensorValue and subtract 16.7674

in other words (constVolt*sensorValue)-16.7674

with constVolt now defined as 1.7348

So here is what I have so far

thanks for any input and Advice,

Carl

/*

Analog input from T/C amp displayed as value on LCD

*Varied 0-5Vdc to analog input 0

*LCD RS pin to digital pin 12
*LCD Enable pin to digital pin 11
*LCD D4 to digital pin 5
*LCD D5 to digital pin 4
*LCD D6 to digital pin 3
*LCD D7 to digital pin 2
*LCD R/W pin to GND
*LCD V0 Pin to 0-5V for contrast

*/

// include library code
#include <LiquidCrystal.h>

// initialize with the numbers of interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int sensorPin =A0; //select input pin for thermocouple amplifier
int sensorValue =0; //variable to store the value coming from the sensor
float temp =0; //variable to store calculated temp

#define constVolt 5/1024 //constant converting analog value 0-1023 to 0-5v

void setup() {
//setup the LCD's number of columns and rows
lcd.begin(20, 4);
}

void loop() {
// read value from T/C:
sensorValue = analogRead(sensorPin);
// convert to degrees F
temp = (constVolt)(sensorValue)(355.2823)-16.7674
//set the cursor to column 0, line 1
lcd.setCursor(0,1);
// print temp value
lcd.print(temp);