I set up a kiln controller some years back using a AD 595 chip. It worked well and gave consistent results form 25F to around 2150F. The only problem was the output was above 5 volts at the high end so I had to use an external 12 volt source and reduce the final signal down to the 5V limit of the Arduino A/D.
So I tried the MAC 31855. All went well till about 1400-1600F then it started throwing wild readings. I tried two different boards different shields, same thing... erratic readings from around 1400F. I did all the usual stuff with caps and twisted pair. Nothing works.
Searching the web, I discovered at least three other people with the same problem, but it didn't look like it got resolved.
The thing is that the readings seem rock solid till some point around 1400F, then the immediately go crazy. Shifting back to the AD 595 shows on instability at all. ???
So I tried the MAC 31855. All went well till about 1400-1600F then it started throwing wild readings. I tried two different boards different shields, same thing... erratic readings from around 1400F.
The data is output in a signed
14-bit, SPI-compatible, read-only format. This converter
resolves temperatures to 0.25NC, allows readings as high
as +1800NC
#include <MAX31855.h>
float tempOut = 0;
int command = 0;
int value;
// Adruino 1.0 pre-defines these variables
//int SCk = 13;
//int MISO = 12;//SO
//int SS = 11;//CS
// Setup the variables we are going to use.
double tempTC, tempCJC;
bool faultOpen, faultShortGND, faultShortVCC, x;
bool temp_unit = 0; // 0 = Celsius, 1 = Fahrenheit
//temp(SCk,CS,SO)
MAX31855 temp(11, 12, 13);
void setup() {
pinMode(2, OUTPUT); // Test Com Reset issue
pinMode(3, OUTPUT);
pinMode(9, OUTPUT);
pinMode (10,OUTPUT);
digitalWrite(10, HIGH);
Serial.begin(9600);
}
void Average10() { // average 10 readings
float Ave;
int AveCt ;
AveCt =0;
Ave = 0;
delay(50);
do {
temp.readMAX31855(&tempTC, &tempCJC, &faultOpen, &faultShortGND, &faultShortVCC, temp_unit);
Ave = Ave + tempTC ; // tempTC ;
AveCt = AveCt + 1;
delay(10);
} while (AveCt < 10 ) ;
tempOut = (Ave/10);
}
void loop() {
if ( analogRead(0)> 1021) { // it's too high turn it off
digitalWrite(2,LOW);
}
value = 0;
Serial.flush();
if (Serial.available()) { // Look for char in serial que and process if found
command = Serial.read();
if (command == 84 ) { // If command = "T" turn it on (unless to high)
digitalWrite(2,HIGH);
// delay (500); // keep it on for at least half a sec to prevent bounce
}
if (command == 67) { // If command = "C" turn it off
digitalWrite(2,LOW);
// delay(500); // keep it off for at least half a second to prevent bounce
}
if (command==68){ //if command ="D" sound tone
tone(9,220);
}
if (command==69){ //if command ="E" end tone
noTone(9);
}
command = 0; // reset command
}
delay(50);
Average10(); // take averaged sample
delay(50);
Serial.flush();
Serial.print("@- ");
Serial.print(tempOut); // output to computer USB port
Serial.println(" -Tmp ");
}
as the commands are single chars, a switch() construction can be used
void loop()
{
if ( analogRead(0)> 1021) // it's too high turn it off
{
digitalWrite(2, LOW);
}
value = 0;
Serial.flush();
if (Serial.available())
{
command = Serial.read();
switch(command)
{
case 'T':
digitalWrite(2,HIGH);
// delay (500); // keep it on for at least half a sec to prevent bounce
break;
case 'C':
digitalWrite(2,LOW);
// delay(500); // keep it off for at least half a second to prevent bounce
break;
case 'D':
tone(9,220);
break;
case 'E':
noTone(9);
break;
default:
Serial.println("invalid command");
break;
}
}
delay(50);
Average10(); // take averaged sample
delay(50);
Serial.flush();
Serial.print("@- ");
Serial.print(tempOut); // output to computer USB port
Serial.println(" -Tmp ");
}
your code does not show any problem at first sight, do you have a link to the max38155 lib used?
looking at the code of your lib, both looks quite similar from functional point of view, so mine will probably give same jumps.
The temperature has 13 bits (0.. 8191) which is divided by 4.0 (0 .. 2047 Celsius) giving a resolution of 0.25
So the protocol itself used does not cause the jumps in the readings.
Q: Can you check with a sensitive voltmeter if the voltage over the sensor is stable?
Q: can it be that the temperature/heat is not equally distributed?
Q: Can you check with a sensitive voltmeter if the voltage over the sensor is stable?
Q: can it be that the temperature/heat is not equally distributed?
I have watched the max readings jump all over the place, while at the same time not change more than 0.1 ma on a voltmeter. I even tried two voltmeters to make sure.
As I said before, the AD 595 is stable under the same conditions.
I am going to try and hook it up to an oscilloscope next time and see if I can see anything.
The heat is evenly distributed. The kiln has a tremendous thermal sink compared to the thermocouple.
This has got to be a noise issue somewhere, but why does it only happen at high temps???
Thanks again Rob... I'll have a try with your library.
The temperature probe is inserted through the side of the kiln wall. It is not in contact with the ceramic pieces so it should be measuring the air temperature inside the kiln.
I ran another test yesterday by just heating the probe tip with a propane torch. The prob tip got up to 1900F and showed no jitter. I held it at this temperature for several minutes with no erratic readings. So I think that there is some noise happening with the electric kiln. The elements should be giving a simple resistive load so I am not sure what might cause the noise to start happening at higher temperatures, but maybe it is coming in through the line rather than the probe.
I'll put an O-scope on it next time I make a run with the kiln.
Measure the AC voltage between the two grounds first .
That was my plan The kiln is 240V
I was searching the web and found another person with this problem who solved it by unplugging his laptop and running on batteries. Seems like the problem just went away. Sounds like noise coming through the line.
I made a run today on a small 120V test kilnand the AC connection is the problem. If I either turn off the kiln or unplug the computer, the signal straightens out immediately. Why this should happen only at higher temperatures is a head scratcher. I put a scope on the thermocouple, and it is much noisier when the power is on but since I can unplug the computer with the power on and not see a problem, I'm still thinking line noise.
Things get curiouser and curiouser... I did a run on my larger 240V kiln and by 1500F the values began getting erratic. Once again the problem stopped as soon as I unplugged the laptop and ran on just battery. The strange thing here, was that the signal stabilized when the kiln came on, rather than when it was off like the smaller 120V kiln.
Both kilns use a solid state switch. maybe there is noise backing up into the Arduino through the input to the switch? Ever hear of anything like that?
RPCoyle:
I made a run today on a small 120V test kilnand the AC connection is the problem. If I either turn off the kiln or unplug the computer, the signal straightens out immediately. Why this should happen only at higher temperatures is a head scratcher. I put a scope on the thermocouple, and it is much noisier when the power is on but since I can unplug the computer with the power on and not see a problem, I'm still thinking line noise.
Maybe the plug on the kiln is wired backwards?
At high temperatures things expand ans maybe some connection gets less tight?
Has the power supply of the laptop a stable output?
At high temperatures things expand ans maybe some connection gets less tight?
Has the power supply of the laptop a stable output?
That is correct Rob, the connections to the thermocouple do get loose if I don't re-tighten them after every run.
The power supply is just the standard plug in that came with the unit. I doubt that it has any high powered filtering going on
I am going to add some filters to the input to the 31855 and see if it makes a difference.