Cobra ADC reading AD594 thermocouple output

I have problems reading output from AD594 via my cobra ADCs.

I have not been able to find a similar topic on the forum - or at least one that I understood
I’m novice to electronics, but an experienced programmer.

Its an type J thermocouple chip that translates readings into 10mV/Celsius

I use the ground/5v out on the cobra.

When i read from an Analog In (say ad3, I have tried others) the results fluctuate a lot.

If I use my volt-meter (across ground Vout (leg 7 & 8)) i get a very stable reading of about 0.204v +/- 0.001v. This corresponds to a temperature of 20.4C, which is very reasonable for my basement temp.

When using analog in pin 3, with a scale of 1…3300, i get readings between .27v and 0v. The result changes every time i read, i doesnt seem to depend the frequency with which i read.

I hope someone can explain this, and advice what to do,

Lars

Have you tried some digital filtering? Values will not be always perfect due to many factors but should be usable.

If you need a very high accuracy then you need a separate ADC chip (connect on SPI or I2C) that is powered from an independent power regulator.

Hi Gus,

Its not really a matter of precision. 10-bit adc would mean a resolution of 3.3mV = 1/3 of a degree Celsius, isnt that right?

Anything within 1-2-3 degrees celsius would be fine.

Below is a sample of the readings from a03 an mV (1 per second). In a similar period of time my v-meter readings was 192-194. I dont understand “digital filtering”, But if you mean (Im guessing ) applying statistical mehtods on data. But they are far to unstable to make sense at all.

10 : 203
11 : 180
12 : 228
13 : 0
14 : 203
15 : 196
16 : 180
17 : 167
18 : 0
19 : 0
20 : 267
21 : 299
22 : 222
23 : 193
24 : 186
25 : 174
26 : 199
27 : 212
28 : 235
29 : 215
30 : 244
31 : 0
32 : 212
33 : 219
34 : 228
35 : 0
36 : 99
37 : 0
38 : 0
39 : 267
40 : 206
41 : 251
42 : 148
43 : 212
44 : 196
45 : 203
46 : 186
47 : 222
48 : 199
49 : 170

Anything connected to other analog inputs? Are you enabling any other analog inputs in software?

No.

I only have three wires on A03, gnd and 5V in/out.

the “whole” program is

        AnalogIn ain = new AnalogIn((AnalogIn.Pin)FEZ_Pin.AnalogIn.AD3);
        ain.SetLinearScale(0, 3300);
        int i = 0;
        while (true)
        {
            int v = ain.Read();
            i++;
            Debug.Print(i.ToString()  + " : " +v.ToString() );
            Thread.Sleep(1000);
        }

Thanks for your quick replies :wink:

I do not understand why you would see 0! What are you using for power? I am also curious on how the numbers look if you sample 50 times faster.

Also, how are you filtering noise on your analog circuit. Like capacitors right by the chip.

Below is some reading with 20ms interval.

First I used the pc-usb as power supply for the cobra. Now I use a somewhat standard 9V 300 ma wall-plugin thing from the closet …

In the example circuits of the datasheet there are no capacitors present, and I was kind of hoping that since I bought a complete circuit, this would all be taken care of. Its so easy when looking at datasheets
:frowning:
I did in fact try to fiddle a little with a capacitor, but I lack knowledge to figure out the size and where exactly to put it …

101 : 496 102 : 409 103 : 141 104 : 196 105 : 164
106 : 248 107 : 199 108 : 41 109 : 174 110 : 225
111 : 203 112 : 219 113 : 0 114 : 203 115 : 196
116 : 209 117 : 209 118 : 145 119 : 164 120 : 261
121 : 228 122 : 302 123 : 6 124 : 145 125 : 212
126 : 257 127 : 141 128 : 25 129 : 196 130 : 161
131 : 219 132 : 170 133 : 0 134 : 170 135 : 186
136 : 193 137 : 180 138 : 0 139 : 12 140 : 257
141 : 54 142 : 0 143 : 151 144 : 0 145 : 154
146 : 174 147 : 45 148 : 219 149 : 193 150 : 0
151 : 54 152 : 196 153 : 0 154 : 0 155 : 177
156 : 6 157 : 193 158 : 51 159 : 0 160 : 199
161 : 41 162 : 206 163 : 70 164 : 0 165 : 141
166 : 0 167 : 174 168 : 209 169 : 132 170 : 219
171 : 0 172 : 199 173 : 212 174 : 38 175 : 222
176 : 0 177 : 257 178 : 177 179 : 0 180 : 228
181 : 16 182 : 167 183 : 103 184 : 0 185 : 177
186 : 32 187 : 183 188 : 199 189 : 77 190 : 203
191 : 0 192 : 215 193 : 222 194 : 0 195 : 128
196 : 109 197 : 177 198 : 203 199 : 0 200 : 486
201 : 64 202 : 460 203 : 447 204 : 116 205 : 515

The decoupling capacitors and other means of having clean signals and power sources are considered more automatically understood so you may not find them mentioned in datasheets.

But why is my own v-meter measurements from ground to Vout absolutely stable?

I use an AD595 and K-Type on a Panda II fed by an ADG407 8 to one multiplexor. I get very stable results to a 12 channel datalog with this code.

int i;

                //get thermocouple 1
                address0.Write(false);// write address to multiplexor
                address1.Write(false);
                address2.Write(false);
                Thread.Sleep(50);// let it stabilize before reading
                VoltTemp = 0;

                for (i = 0; i < 50; i++)                //smooth 50 readings
                {
                    int voltage = PinVoltage.Read();
                    VoltTemp = VoltTemp + voltage;
                    Thread.Sleep(1);// absolutely essential or you will get major TC noise
                }
                therm1 = VoltTemp / 50;
                therm1 = (therm1 * thermAdjust / 10);
                LCD.Write(1, 1, ((therm1).ToString("F0")));

It might work for you.

You probably want to add at least one 0.1uF (100nf) capacitor at the analogue header from Ad3 to Gnd, then average 2-3 readings. You will also want a 0.1uF and possibly something like a 1uF cap from the AD595’s VCC to GND.

The ones on the AD595 will decouple it’s power supply somewhat and smooth out any voltage fluctuations caused by current draw or other ripple in the circuit. This will give it a nice stable power supply which it needs for conversions.

Your multimeter will have some smoothing and filtering in it (this is why when you switch voltages on a DMM it will not change to the new voltage immediately - it will lag slightly behind). This is why your reading is dead level.

I’ve only played with the AD595 briefly however I do recall getting very stable and accurate readings from K-Type thermocouple. I didn’t have any filtering or decoupling on mine, however I know my power supply was very stable and also very clean.

In my app I record every 5 seconds so the large delays I built in are no problem. Even on my commercial daq’s I have to crank the sample size up to 20 to get clean readings.

This is an example of the output for just the TC’s

2011-06-02-02-23-34 167.19 45.83 122.07 75.13 30.94 28.88 63.63 16.8
2011-06-02-02-23-37 166.93 46.08 122.15 75.33 30.98 28.75 63.09 16.39
2011-06-02-02-23-39 168.24 47.2 121.47 76.13 30.63 29.23 62.56 16.14
2011-06-02-02-23-42 167.34 47.34 121.54 75.67 30.41 30.63 62.85 16.34
2011-06-02-02-23-45 168.15 48.36 121.38 75.5 30.59 28.9 63.09 16.21
2011-06-02-02-23-47 168.18 49.28 121.95 76.06 30.48 29.26 63.31 16.13
2011-06-02-02-23-50 168.61 50.86 122.24 75.63 30.9 29.3 63.88 16.51
2011-06-02-02-23-52 168.2 50.85 122.73 75.73 31.15 29.33 65.1 16.69
2011-06-02-02-23-55 167.67 50.71 121.96 75.02 31.1 28.94 64.43 16.77
2011-06-02-02-23-57 168.44 51.62 122.83 75.8 31.14 29.5 63.91 16.56
2011-06-02-02-24-00 168.11 52.92 122.84 75.05 30.78 29.58 64.77 16.74
2011-06-02-02-24-02 168.54 53.7 123.25 75.55 31.46 29.18 64.82 16.47

The record rate in this set is 3 seconds, and it reads a tach, current, voltage and cfm as well. If you need faster reading you could use FOR loops and experiment with them until they become unstable. The response time for a K-type thermocouple is very slow, even 26 gauge so you won’t get much from faster readings.

Thanks to both of you, MarkH and randomr,

I will need to buy some stuff to try out your advices, so it will take a couple days.

Lars

I have a couple of suggestions that might save you some time as you build out your TC datalogger. The AD594 and 5 are two versions of the same chip, one biased for J-type and one for K-type. The K-type is slightly more linear and will stand higher temperatures.

If you are not using a split power supply, they will not read below 0 C and both are biased to read 25C at 250mv. Temperatures below 25 C will be slightly non linear because of this and that the ADC is non linear at lower voltages due to a slight offset which you will find in the board datasheet. This is addressable with a little calculus if it is a problem for you.

The AIN on the Panda must be 3.3 v or less so you can only read to 330C. My requirements were a minimum of 450C so I dump the output of the AD595 into a voltage divider before sending it to the An In pin. That is what the thermAdjust number in my code is for.

I would advise against putting any filter caps on the An In pin. It will give you a very smooth readings, but the reading will be wrong, invariably too low in my work, compared against a Handheld Atkins thermocouple meter.

The data sheet for the AD595-4 suggests that the ground to pin 1 is optional. If you are not using a split power supply I believe it is mandatory as I could not get reliable results any other way.

A 50 mfd cap as close to the Vcc of the AD595(4) as possible is also pretty much required

I think I have by now tried all your suggestions.
And it’s not really working.

I bought an 7805 based voltage regulator: http://www.electrokit.se/download/G008.pdf
Is it something like this I should use to supply power? - I not, would you recommend something?

And I have also tried the various suggestions concerning capacitors.
If I use the AD594 as a stand-alone thermometer without attaching a sensor (connect 1 and 14), I get somewhat stable readings, but they still fluctuate +/- 4 d.celsius measured once a second.

Using a sensor it fluctuates much more.

randomr: Do I understand you right, that you are using a moving average of 20 observations? That would of course smoothe things out, but also give unprecise and slow response times. I tried using 5 obs. but that still fluctuated a bit.

I dont expect that I need to measure more than 330 C (I need to measure the smoke temp. in my
chimney) probably 250-300 max.

Thanks again for your help.

Lars: The code I use averages 50 readings as fast as the Panda will read them (I assume the Cobra adc is not much different) except for the 1 millisecond Thread.Sleep. But if you look at the table I posted a while back you will see that the readings are very stable. This piece of equipment runs for days at a time and the graphed curves are extremely smooth. On all 8 thermocouple channels from 25C to 425c on therm 1 and up to 225 c on Therm 2 and 3.

The Thread.Sleep(1) is essential. Without it you will get major TC noise.

Here is a graph of the unit in operation with 6 of the TC readings shown. If you look at the blue green stack line, you will see the noise as I missed adding the sleep line in my first run through.

The data from my commercial Omega Daq’s is no smoother.

To give you a comparison, here is a graph from a $1500 16 bit commercial Omega DAQ. The timebase and y axis are different in this run and it is an average of 20 samples and slightly smoother than the $39 Panda, but not much.

You have to bear in mind that they are trying to make nanosecond wide reading of microvolts, pass them through 2 opamp stages and adjust for CJC effects.

More than close enough for me. ;D

Hi again,

Thanks a lot, now I finally get sensible results.

There’s still an occasional peak but in general the readings are fine, and consistent with the thermocouple on my meter.

Sorry, I didnt pay the right attention the code you posted.

Lars