| Arduino Forum ::  Members :: SheepRustler
 Show Posts Pages: [1] 2
 1 Using Arduino / Sensors / Re: Thermocouple problem on: August 22, 2014, 07:30:30 am Hello Mantzas,Another thing to check is that you are using the correct MAX31855 chip for your thermocouple. For example a MAX31855T should be used for T types, a MAX31855K for K Types etc. it may be that your thermocouple is falling out of range when its heated. The thermocouples are colour coded usually....Good luck, let us know how you get on.
 2 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: August 22, 2014, 07:25:07 am Hello All,Just to rekindle things here's the code I settled on to derive the voltage from the MAX 31855 chip and then re-calculate the corrected temperature using a 7th order polynomial.It's a bit of hack and it works better than anything I've tried at these low (~150C) temperatures, but it's still not perfect. Any suggestions  welcome...!Code://Non Linear Thermocouple Compensation Coefficients //Used to calculate actual temp from voltage from the MAX31855// 0 to -200 const float c0=0;const float c1=25.949192;const float c2=-0.21316967;const float c3=0.79018692;const float c4=0.42527777;const float c5=0.13304473;const float c6=0.020241446;const float c7=0.0012668171;// 0 to 400const float d0=0;const float d1=25.928;const float d2=-0.7602961;const float d3=0.04637791;const float d4=-0.002165394;const float d5=0.00006048144;const float d6=-0.0000007293422;const float d7=0;//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//SUB to get Compensated Thermocouple Value from Junction Value & Reference Valuesfloat TCComp(float external, float internal){  //do the Non Linear Temp Compensation Calculation here  float TCTemp;    float Vout=MAXc * (external-internal)/1000; //calculate  volts out from the MAX in millivolts    //Now calculate the corrected temperature    if (Vout<0)       {TCTemp=internal-c0+(c1*Vout)+(c2*pow(Vout,2))+(c3*pow(Vout,3))+(c4*pow(Vout,4))+(c5*pow(Vout,5))+(c6*pow(Vout,6))+(c7*pow(Vout,7));} //Below Zero  else       {TCTemp=internal-d0+(d1*Vout)+(d2*pow(Vout,2))+(d3*pow(Vout,3))+(d4*pow(Vout,4))+(d5*pow(Vout,5))+(d6*pow(Vout,6))+(d7*pow(Vout,7));}  //Above zero    return TCTemp;}//end of TCComp
 3 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: June 16, 2014, 10:21:35 am Ahh, hang on....Is the temperature derived from the tables the variation from the reference temperature and not the absolute temperature?So that:Actual temp = TAMB-(d0+d1*VOUT+d2*VOUT^2+ etc. +d7*VOUT^7 )Perhaps...?
 4 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: June 16, 2014, 10:00:15 am Istadniy,I'm struggling to get this to work out - can you help me out here? Using the equation in the MAX data sheet :  VOUT= (52.186 uV/degC) x (TR- TAMB) (here for a T  type) I'm using TR as the (incorrect) 'external' temperature returned by the MAX (say 20 deg C) and TAMB as the reference (internal chip) temperature of 24 dec C. This gives me a VOUT = 0.20872mV.Using this value in the NIST polynomial equation T=d0+d1*VOUT+d2*VOUT^2+ etc. +d7*VOUT^7 using the following coefficients:d0   0.0000000000000d1   25.9280000000000d2   -0.7602961000000d3   0.0463779100000d4   -0.0021653940000d5   0.0000604814400d6   -0.0000007293422d7   0.0000000000000I get a 'real temperature of  -5.445 C which is plainly wrong.I suspect Im doing something wrong in calculating the VOUT - any ideas that point me on the right direction?Thanks
 5 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: June 11, 2014, 05:37:45 pm Thanks Istadniy, I never thought to look on YouTube. I watched the clips, really useful thanks and it seems to make sense. I'll try it out as I'de really like to get it working more accurately than I have it now. I appreciate you taking the time to reply, thanks
 6 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: May 23, 2014, 05:48:51 pm OK, (anyone who's still got the patience to listen!) here's the latest in my attempts to understand this weird thermocouple behaviour....I've tried every combination of the following:Libraries:Cory J Fowler's libraryGeorge Matthew's libraryAdafruit libraryRob Tilliart's library(Many thanks to the above for all their efforts and help - it's much appreciated)with...A T-Type thin wire thermocouple A K-Type thin wire thermocoupleand...A 'BBTech' T Type amplifier breakoutA 'Playing with Fusion' K Type 4 Channel breakoutAn 'Adafruit' 31855K breakout.Everything seems OK at or around room temperature down to 0C, but my domain is in liquid nitrogen around -188C and warmer.All the combinations (and an Adafruit RTD PT100) seem to give similar results, the attached graph (THERMO TEST.JPG) shows a calibrated meter (fitted with two K Types) against a 'BBTech' breakout fitted with a T type and a 'Playing with fusion' with a K Type (four actually and averaged). All the libraries give similar results.The test involved dunking all the thermocouples into liquid nitrogen (-188C) and allowing to warm back up to room temperature whilst logging the output. This was repeated many times with different combinations of library and hardware.After looking at the first graph, I worked out can 'fudge' the results by applying the following  'correction factor' Corrected Reading = Actual Reading+(0.71*Actual Reading)This results in the second graph (FUDGED.JPG) output, which is probably near enough for what I need, but I'm really like to know what the problem is.....Any thoughts anyone? Thanks....
 7 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: May 03, 2014, 04:13:13 pm Thanks again George, I tried your library, neat, but same result. I'm now convinced its hardware problem rather than software. I love to hear from anyone who has successfully used a  MAX 31855T with a T Type as I'm beginning to suspect the chip as both the the BBetch and Playing with Fusion breakouts give similar results, the common factor being the MAXIM chip. Or perhaps its the way I've wired it - did your K Type set up work OK on a breadboard?  I suspected perhaps a mis-labelled thermocouple, was a K type masquerading as a T type? I tried a brand new one. Nope same thing.I wish I could use a K Type, but the application demands a T type. Thanks for your post....
 8 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: May 03, 2014, 07:57:58 am Well my new 'Playing with Fusion' T type board and bi-directional level shifter arrived from US the other day so I rebuilt the circuit as the attached picture, connected up a T Type, loaded the sketch supplied by the guys at playing with fusion.......and it reads with the same kind or error as the BBTech board.... arghh now I'm wondering if there is something fundamentally wrong with the MAX 31855. Has anyone out there ever got reliable readings from this chip?   I tried the code below based on Cory Fowler's library too, same result.Noticing that the board doesnt like to be poked or moved (it results in error readings) I also wonder if there is something wrong with building this circuit on a breadboard - I've seen a few posts on the forum suggesting this can be problematic with some devices. Any experience of this anyone? Any other suggestions anyone? This is driving me bonkers.....Here's the hardware Im now using:Playing with Fusion Level shifter : http://www.playingwithfusion.com/productview.php?pdid=23 Playing with Fusion 4 Channel T Type MAX31855T board :  http://www.playingwithfusion.com/productview.php?pdid=35&catid=1001 There's a Playing with Fusion sketch at the site too. ...and here's the code adapted from Cory's example.Code:#include #include const int csPin1 = 10;//the pin asked to read  CSconst byte scale = 0;   // 0 is Celsius/Centigrade, ~80µs. 1 is Kelvin, ~108µs. 2 is Fahrenheit ~100µs. 3 is Rankine, ~100µs.byte error;double external;double internal;MAX31855 TC1(csPin1);void setup(){  Serial.begin(57600);  pinMode(csPin1, OUTPUT);  digitalWrite(csPin1, HIGH);}void loop(){  TC1.getTemp(external, internal, scale, error);  Serial.print("Cold Junction Temp: ");  Serial.print(internal);  Serial.print("C   ");  Serial.print("Thermocouple Temp: ");  Serial.print(external);  Serial.println("C");  if (error & 0x01){    Serial.println("ERROR: Thermocouple Open!!");  }else if (error & 0x02){    Serial.println("ERROR: Thermocouple Shorted To Ground!!");  }else if (error & 0x04){    Serial.println("ERROR: Thermocouple Shorted To Power!!");  }  delay(1000);}
 9 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: April 30, 2014, 04:20:03 pm Thanks George,I'm pretty sure that I am using a T type thermocouple (they are labelled 'T' Type) and a T type board (the chip is suffixed 'T'). I've tried several makes of T type thermocouple, all give the same result, so I suspect the board.Kit:Black Box Tech MAX31855 T Type breakout board, details here:  https://www.tindie.com/products/BBTech/max31855-ktrj-type-thermocouple-module/T Type thin wire Thermocouple:http://r.ebay.com/Qev8yeCuriously I've just noticed that increasing the temperature of the MAX31855T (by putting my finger on it) increases the reported temperature of the thermocouple too - to the correct temperature of the room. I'll try this when I get back in the lab with some liquid N2.Im waiting for the postman to deliver some new 'Playing with Fusion' T type boards, so we'll see how those work.Thanks for posting...
 10 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: April 27, 2014, 04:32:32 am Quote from: pylon on April 23, 2014, 07:41:05 pmQuoteThe chip operates only at 3V3 (according to the datasheet, page 2: absolute maximum ratings for Vcc is 4.0V), so maybe that information is just wrong and you have to drive it with not more than 3.3V to get reliable results. It's possible that the module includes a voltage regulator but we don't know it. You might measure the voltage between pin 1 and 4 of the chip during operation.When operating the voltage between pin 1 and 4 of the MAX31855T on the breakout board is 3.109 V, which I think is just within the recommended operating range of the chip as per spec sheet (3.0v to 3.6v). Im feeding the breakout board with 5.06v from Vcc on the Arduino so I guess there must be a voltage regulator on the board.
 11 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: April 25, 2014, 04:13:10 am Thanks again Pylon,Im coming to the same conclusion as the other reviewer I think - (the review has strangely disappeared)  but I'll try the voltage measurement. Its a shame as the boards feel and look nicely made.In the meantime I've ordered one of these: http://www.ebay.co.uk/itm/MAX31855-Quad-Ch-T-Type-Thermocouple-Breakout-MAX6675-upgrade-3V-Arduino-Comp-/331184452404?I'll report back on how that one performs....
 12 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: April 23, 2014, 04:09:47 pm Hello jremington,Here at home I'm at 600ft ASL (so should be about 99.3 C  I reckon) and my thermo peaked at 88.75C, but at my previous test  I was only at about 40ft ASL and the thermocouples still read only about 88\89C in a boiling kettle - then I had a calibrated Fluke in there too which read a shade under 100C.I'm stumped.....!? My next test will be to use a different make of breakout board as that seems to be the only common factor.Thanks
 13 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: April 23, 2014, 02:34:57 pm Thanks Pylon,Yes I think K types are very similar - my knowledge of thermocouples has only started in the last few weeks so most of it is new to me. I'm away from my liquid nitrogen supply for a few days, but attached is a couple of print outs using Cory's library in DEBUG mode, hopefully it means more to you than me!I'm a bit limited to what temperatures I can use here at home - my cooker and my freezer.... Attached are printouts from both, any use? This is on a Micro Pro 5v wired very simply as per the attached photo.Thanks for your help,++++EDIT+++Also attached is a Boiling water file set - about 88.5C but measured as 100C with an (uncalibrated) cooking thermometer from my kitchen drawer...
 14 Using Arduino / Sensors / Re: MAX 31855 and Thermocouple Errors on: April 23, 2014, 07:55:02 am Hello Pylon,Thanks for taking the time to reply, much appreciatedI didn't time the response between Corry Fowlers and Rob Tilliaart, but both are much faster than I need. In the finished state Im sampling at about 1 Hz. I'll have another look at Corry's but the output is the same anyhow.I measured the 'actuals' using two other devices:  A JUMO digital thermostat and also a hand held Fluke fitted with a thermocouple probe. Both are calibrated and gave very similar readings. Im pretty sure they are correct. I also put the Fluke probe and my probe in a kettle and boiled it. The fluke read 99.8C my probe 80C and I've done the same with some liquid N2, Fluke measured -140C, mine read -80C.I've tried four ways of connecting the probes physically as described in my original post but there's a photo attached - all methods seem to result in the same reading.With a magnifying glass I can just read 'MAX31885 T' on the chip on the breakout board. Does the T signify T type I wonder ? On the reverse side they have 'Type T' written on them.Thanks