Computing stuff tied to the physical world

Thermocouple enigma

In Hardware on May 8, 2010 at 00:01

I’ve been scratching my head while trying to get the Thermo Plug to work with an on-board AD597 + thermocouple.

Sure, it works fine…

But only on a 4.5V battery pack! When I connect this thing through a USB-BUB, the readings are severely distorted 9 out of 10 times.

Here’s a sample of the readings on USB:

251 251 251 238 244 261 238 248 251 254 251 206 241 261 251 254 241 209 244

Here are some readings I get on battery power, i.e. not attached to anything:

206 209 206 206 206 209 206 209 209 209 206 206 206 209 203 206 206 206 209

This is the sketch I’m using (code here):

Screen Shot 2010 05 07 at 14.36.29

I’ve tried to rule out noise and other flakiness on the 5V PWR pin by adding capacitors and even a ferrite bead to filter out HF, but none of it seems to have any effect.

Big puzzle! Does anyone have any suggestions what else to try?

The good news is that everything works fine with batteries, so I can continue working on the code for my reflow grill controller. It needs an update because the NTC has a flaky wiring connection (can’t use solder there!) and because I want an accurate temperature readout without having to calibrate things.

  1. How very strange… Have you tried it with a non-PC derived 5 volt like 4 AAs and a 5 volt regulator?

  2. It could be a ground loop and one other thing I don’t think you should solder a thermocouple, because it gives an undefined junction of metals.

    Best regards Henk

    • Latest discovery: works fine on batteries, goes haywire when on batteries with just USB-ground connected to the PC (or any other pin). Did the laws of physics change recently?

      Good point about the thermocouple – I’m using screw terminals now.

  3. Common-mode voltages on the thermocouple inputs must remain within the common-mode voltage range of the AD596/AD597, with a return path provided for the bias currents. If the thermocouple is not remotely grounded, then the dotted line connection shown in Figure 1 must be made to one of the thermocouple inputs. If there is no return path for the bias currents, the input stage will saturate, causing erroneous output voltages.

    this is written on page 4 of de AD datasheet http://www.analog.com/static/imported-files/data_sheets/AD596_597.pdf

    And it seems to be ok to solder the thermocouple according to the datasheet.

    Best regards,

    Henk

  4. Thx. Yes, I’ve connected the TC on the chip side, see http://cafe.jeelabs.net/lab/tp1/jlpcb-046.pdf – but you’re right, it has to be something like this. I’ll double-check the schematic and board.

    • I saw it, maybe it’s c1 it could be to small or there is to much noise on the 5V from the usb. Try a bigger cap, or a extra inductor to create a LC filter.

  5. I suggest using ADC with noise reduction mode and adding some more caps to 5V lines near MCU

  6. Thx. I’ve tried bigger caps (electrolytic and ceramic), and also tried a ferrite bead in series. No change.

    I’m going to hook up the scope. Everything seems to be pointing towards a power problem, given that the 100% floating battery setup works as expected.

  7. Try to plot visually your data so you can see some kind of pattern, if you sample quick enough you should see some 50Hz noise pattern in your data…

    • Good tip.

      it gets weirder. Sometimes the whole setup works just fine on USB. Here’s a snapshot, note how long nothing happens after 23:38:12 …

      23:37:56.179        . (adav) OK 33 206 0
      23:38:01.168        . (adav) OK 33 209 0
      23:38:02.164        . (adav) OK 33 229 0
      23:38:03.162        . (adav) OK 33 209 0
      23:38:04.159        . (adav) OK 33 206 0
      23:38:11.144        . (adav) OK 33 203 0
      23:38:12.142        . (adav) OK 33 206 0
      23:38:33.093        . (adav) OK 33 209 0
      23:38:37.083        . (adav) OK 33 206 0
      23:38:38.081        . (adav) OK 33 209 0
      

      Since only changes are sent, this means the readout is totally stable for over 20 seconds, up to the very last bit!

      The rest is pretty stable as well, pretty much the same LSB jitter as on battery power. And pulling at things and moving cables around has no effect at all.

      The only glitch is at 23:38:02 … a huge 2°C blip.

      When I leave it running for a while, I do notice an occasional high-temp blip, off by about 5°C. Less than once a minute, on average. But still on USB – nothing like the mess I got earlier. I’m sure it’ll be back tomorrow :)

      I’ve been postponing hooking up the scope, because I’ve got to work on some other things first (and because I’m afraid that hooking up a probe might affect this setup in yet another way).

Comments are closed.