Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Circuit Pic16f877 / thermocouple K / ad623 problem

Status
Not open for further replies.

Zwilorg

Member level 5
Joined
Oct 13, 2010
Messages
89
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
1,906
hello,

i am here to ask how can i get the thermocouple type K working with an AD623 opamp!

i have the program on the pic16f877 working without any problem i believe...

i used the Potenciometer (RV5) connected to AN0 for posterior conversion of data from analog to digital, just for testing...

i never thought i would have so much problems getting the data from the thermocouple....

Can someone check my circuit and see what is wrong in the build of the opamp?

Everything else is right and tested :p so just focus on the AD623 and the thermocouple


In this picture i used the REF on AD623 as +2.5V just to see what it would give as a result... i used ground also...


I also read that i could use max6675 more easilly than add623 but the maximum temperature it reaches is 1024C is this true?


ad623.png

PHP:
http://dl.dropbox.com/u/2769457/ad623.png
 

what is the range of voltage difference across the thermocouple?
 
Why you are not using AD595?
When you are using opamp you should care about its input and output offsets and drifts VS ambient temperature.
After that you should compensate reference (or cold) junction temperature in your PIC.
The AD595 do all this works! The AD595 have an amplified and compensated output that you can use in your circuit.
 
what is the range of voltage difference across the thermocouple?


i am using a type k thermocouple made with Nickel-Chromium,

so the range is from

0ºC -> 0.0mV

to

1250(close enough) -> 48 or 49mV

---------- Post added at 16:56 ---------- Previous post was at 16:49 ----------

Why you are not using AD595?
When you are using opamp you should care about its input and output offsets and drifts VS ambient temperature.
After that you should compensate reference (or cold) junction temperature in your PIC.
The AD595 do all this works! The AD595 have an amplified and compensated output that you can use in your circuit.


i am still not very confortable working with opamp! i will read some more and try to make it work with the ad595.

i was using the ad623 cause it was pointed out to me.... :S

Thank you for your input!
 

What voltage are you seeing at the output of the opamp at room temp?
 
Hi Zwilorg
I insert the Voltage-Temperature table of type K.
 

Attachments

  • z204-206.pdf
    92.5 KB · Views: 192
I recommend you to using AD595(for type K) or AD594(for type J) or LT1025(for types E, J, K, R, S, T) rather than using thermocouple output directly(i.e with an amplifier).
The output of AD595(in case of using type K) is directly proportional to Hot junction temperature. But if you use thermocouple output directly, you must measure ambient temperature to compensating reference temperature. such operation causing many error on measuring Hot junction.

---------- Post added at 18:11 ---------- Previous post was at 18:09 ----------

Also you can recalibrate AD595(or AD594) for any type of thermocouples.
 
There are application notes about cold junction compensation.
 

Attachments

  • Cold Junction compensation.zip
    320.8 KB · Views: 214
Thank you all for the help!

i am sorry for not answering before.

I tried making it work with the ad595 and it finaly read something on the simulator :wink:

it was as followed:



https://obrazki.elektroda.pl/43_1302708799.png

but the numbers reading over the rs232 and the lcd are all messed up...

i did the following on the MPLAB, hitech compiler

short int adc_res;
short int temp_c;
const double res=14.59;

adc_res =(((unsigned int)ADRESH)<<8)|(ADRESL);


temp_c=(adc_res*(short int)res)/10;
or
temp_c = 5 * (float)adc_res / 1023 ;

neither worked properly...



many thanks for all the quick help!
 
Last edited:

Which compiler you are using?
I think that "Short int" is an 8bit integer while you used it for holding a 10bit ADC result.

---------- Post added at 09:40 ---------- Previous post was at 09:32 ----------

Zwilorg!
Note that AD595 amplifies and compensates the thermocouple output but does not correct the nonlinearity of thermocouple output!
It's better to first measuring the output voltage of AD595 and then convert it to temperature by using type K "VT" table.

---------- Post added at 09:45 ---------- Previous post was at 09:40 ----------

Of course it's not applicable if you want to store all of the data in "VT" table in a MCU. Instead you can divide the "VT" table in a few part and assume a constant Temperature coefficient for each part.
 
Which compiler you are using?
I think that "Short int" is an 8bit integer while you used it for holding a 10bit ADC result.

---------- Post added at 09:40 ---------- Previous post was at 09:32 ----------

Zwilorg!
Note that AD595 amplifies and compensates the thermocouple output but does not correct the nonlinearity of thermocouple output!
It's better to first measuring the output voltage of AD595 and then convert it to temperature by using type K "VT" table.


how can i do that?

is it a floating table?

and btw is the circuit built properly? i just copied it from the app notes ^^
 

Another way is to convert measured voltage to temperature by using formula.

---------- Post added at 09:54 ---------- Previous post was at 09:46 ----------

You can test your circuit by using a voltmeter. in 25C the output of AD595 should be about 250mv.
 
See this for VT table and formula:
 

Attachments

  • Type K.txt
    17.7 KB · Views: 129
Another way is to convert measured voltage to temperature by using formula.

---------- Post added at 09:54 ---------- Previous post was at 09:46 ----------

You can test your circuit by using a voltmeter. in 25C the output of AD595 should be about 250mv.


this was exactly what i was trying to do! i believe that although the formula is right, the circuit or the conversion bit of the adc (adc_res =(((unsigned int)ADRESH)<<|(ADRESL);) are wrong!

but i just don´t know which. i really never thought i would get stuck in this part hehe
 

Also for more information about thermocouples, VT tables and conversion coefficient see "www.srdata.nist.gov"

---------- Post added at 10:03 ---------- Previous post was at 10:01 ----------

If you get a 250mv (in 25C) output from AD595, then every things is OK!

---------- Post added at 10:11 ---------- Previous post was at 10:03 ----------

Define adc_res as Unsigned int and try again.
 
Also for more information about thermocouples, VT tables and conversion coefficient see "www.srdata.nist.gov"


tried that ;) but it is srdata.nist.gov with the "www." it goes to a 440 thanks ;)


If you get a 250mv (in 25C) output from AD595, then every things is OK!




i am getting now for:

unsigned int adc_res;
adc_res = (ADRESH<<2) + (ADRESL>>6);

and output of adc_res=102

and with

unsigned int adc_res;
adc_res =(((unsigned int)ADRESH)<<8)|(ADRESL);

and output of adc_res=6654
 

Try this:
unsigned int adc_res;
adc_res = (ADRESH<<8) + ADRESL;


exactly the same output as

adc_res =(((unsigned int)ADRESH)<<8)|(ADRESL);


maybe the error is on the circuit i posted above with the ad595?
 

I simulate your circuit, the output of thermocouple is exactly 1.000mv(in 222C) but the output of AD595 is 2.48. in simulation the output of AD595 have about 250mv offset.
 

Attachments

  • 1.JPG
    1.JPG
    69.5 KB · Views: 474
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top