Uno works once with thermocouple but not anymore

I'm using the Uno on WinXP SP3. The Uno is recognised in device manager & a reset gives blinking on pin 13, apparently indicating the boot loader is working.

Uno green ON & orange TX lights both ok.
Uploads invariably work OK but serial monitor shows no temperature gradient on power & reset, using the AD595 thermocouple, the led of which does not light to signify a problem.
In Tools the Uno board & Com port 3 are both selected.
All physical connections have been checked.

If you have some thoughts on a potential fix I would appreciate your help.

Thanks
dalpets

Not enough information. Please read "how to use this forum" at the top.

jremington:
Not enough information. Please read "how to use this forum" at the top.

All I can add is that the relay tests OK & also see the sketch below. If not enough info would you like to further specify what you feel is relevant.

Project detail is at File:Ss-relay-etc.jpg - RepRap

The thermocouple kit I'm using is depicted at http://store.makerbot.com/electronics/electronics-kits/thermocouple-sensor-v1-0-kit.
The +/- silk screen error on this board has been accounted for.
Thanks
dalpets

/*

2 November 2011

Licence: GPL

*/

const int heatPin = 13; // the number of the LED pin. This also controls the heater
int heatState = LOW; // heatState used to set the LED and heater
long previousMillis = 0; // will store last time LED/heater was updated
const long interval = 1000; // interval at which to sample temperature (milliseconds)
const int tempPin = 0; // Analogue pin for temperature reading
long time = 0; // Time since start in seconds
bool done=false; // Flag to indicate that the process has finished

// The temperature/time profile as {secs, temp}
// This profile is linearly interpolated to get the required temperature at any time.
// PLEN is the number of entries
#define PLEN 6
long profile[PLEN][2] = { {0, 15}, {120, 150}, {220, 183}, {280, 215}, {320, 183}, {350, 0} };

// Linearly interpolate the profile for the current time in secs, t

int target(long t)
{
if(t <= profile[0][0])
return profile[0][1];
if(t >= profile[PLEN-1][0])
{
done = true; // We are off the end of the time curve
return profile[PLEN-1][1];
}
for(int i = 1; i < PLEN-1; i++)
{
if(t <= profile*[0])*
_ return (int)(profile[i-1][1] + ((t - profile[i-1][0])(profile[1] - profile[i-1][1]))/_
_ (profile[0] - profile[i-1][0]));
}
return 0;
}
// Measure the actual temperature from the thermocouple*
int temperature()
{
return ( 5.0 * analogRead(tempPin) * 100.0) / 1024.0;
}
// Get the show on the road
void setup() {
* pinMode(heatPin, OUTPUT);
pinMode(tempPin, INPUT);
Serial.begin(9600);
Serial.println("\n\n\nTime, target, temp");
done = false;
}
// Go round and round*
void loop()
{
* int t;
unsigned long currentMillis = millis();*_

* if(currentMillis - previousMillis > interval)*
* {*
* previousMillis = currentMillis; // set next time*

* // Get the actual temperature*

* t = temperature();*

* // One second has passed*

* time++; *

* // Find the target temperature*

* int tg = target(time);*

* // Simple bang-bang temperature control*

* if (t < tg)*
* {*
* heatState = HIGH;*
* } else*
* {*
* heatState = LOW;*
* }*
* // Turn the heater on or off (and the LED)*
* digitalWrite(heatPin, heatState);*

* // Keep the user amused*
* if(done)*
* {*
* Serial.print((char)0x07); // Bell to wake the user up...*
* Serial.print((char)0x07);*
* Serial.print("FINISHED ");*
* }*
* Serial.print(time);*
* Serial.print(", ");*
* Serial.print(tg);*
* Serial.print(", ");*
* Serial.println(t);*
* }*
}

Is your sketch uploading to the UNO correctly ?

Is your sketch starting ?

Is your serial monitor process working properly ?

Are you seeing the output of this line, on the serial monitor ?

Serial.println("\n\n\nTime, target, temp");

do you know if your thermocouple actually works ? You should be able to see if there is a voltage on the output of it using a digital voltmeter.

michinyon:
Is your sketch uploading to the UNO correctly ?
Yes, upload completes without error
Is your sketch starting ?
Not sure what you mean
Is your serial monitor process working properly ?
Yes
Are you seeing the output of this line, on the serial monitor ?
Yes, scrolls continuously at ambient (no temperature rise)

Serial.println("\n\n\nTime, target, temp");

Thanks
dalpets

michinyon:
do you know if your thermocouple actually works ? You should be able to see if there is a voltage on the output of it using a digital voltmeter.

Yes, 4.99v dc

Thanks
dalpets

OK, well that might be a problem if it is continually stuck on it's maximum limit.

Should you be getting 4.99 volts from the sensor ? According to your code, that is 500 degrees.

Take it out of the fire, what voltage do you get then ?

It might be useful to print the actual number, which is an integer, that you get from the analogRead( ).

michinyon:
It might be useful to print the actual number, which is an integer, that you get from the analogRead( ).

Remember I'm a newbie at this-how do I do the above?

Thanks
dalpets

int adc_val ;

int temperature()
{
 adc_val = analogRead( tempPin );
 return ( 5.0 * adv_val * 100.0) / 1024.0;
}

and then print adc_val with the other outputs.

The actual voltage created by the thermalcouple junction is small. It requires an amplifier, which I would suppose is what the other device does. But you should check. The 4.99 V sounds wrong. You may be looking at the power input of the device, not the measurement output.

Hi,

Used this as a starting point for a Car (CHT) Cylinder Head Temp Gauge.

see here Hobbybotics AD595 Thermocouple Breakout V1.0 | Hobbybotics

*
 Demonstration sketch for Hobbybotics AD595 Thermocouple breakout board.
 
 Reads temperature from AD595 in Celsius and Fahrenheit. Prints results to serial monitor.
*/
 
#include <AD595.h>
 
AD595 thermocouple;
 
void setup() {
  Serial.begin(9600);
  thermocouple.init(0);
 
  Serial.println("AD595 test");
  // wait for AD595 chip to stabilize
  delay(500);
}
 
void loop() {
  // basic readout test, just print the current temp
 
   Serial.print("C = "); 
   Serial.println(float(thermocouple.measure(TEMPC)));
   Serial.print("F = ");
   Serial.println(float(thermocouple.measure(TEMPF)));
 
   delay(1000);
}

michinyon:

int adc_val ;

int temperature()
{
adc_val = analogRead( tempPin );
return ( 5.0 * adv_val * 100.0) / 1024.0;
}




and then print adc_val with the other outputs.

The actual voltage created by the thermalcouple junction is small. It requires an amplifier, which I would suppose is what the other device does. But you should check. The 4.99 V sounds wrong. You may be looking at the power input of the device, not the measurement output.

The voltage was measured across +/- at the the 3 pin end (AO/LED end) of the thermocouple board, not the oven cable end.

The above code upload gives following output;

sketch_marlla:ino: In function 'int temperature()':
sketch_marlla:5: error 'temp Pin' was not declared in this page
sketch_marlla:6: error 'adv_val' was not declared in this page

Thanks again
dalpets

Thanks for your inputs.
It looks as if I have a simple solution to the problem viz., turning on the timer on the oven. A poster in another thread recently told me it was uneccesary to do so. It appears that is not correct.

With the timer on I plotted the temperature gradient with the sketch used and it cycles as it should through the temperature range.

Sorry for the fuss

thanks again
dalpets