Apparent grounding problem with a thermocouple amplifier, when USB is not connected

Status
Not open for further replies.

christoph

Well-known member
I'm having a hard time debugging an application that uses a thermocouple amplifier (see here: https://forum.pjrc.com/threads/2610...hermocouple-amplifier-breakout-board-(AD849x)).

  • The amplifier's output is connected to A9
  • The VUSB<->VBAT trace is cut for battery operation, and the Teensy is supplied by an external power supply.

When I have the USB cable connected to a PC, my temperature readings are good. When I have no USB cable connected, the readings are far off (between 7° and 50° when I measure my hand's temperature). I suspect a grounding problem, but it could be anything, really. I'm using uGFX to display the output, here is my loop():

Code:
void loop()
{
  static const uint8_t bufSize = 20;
  static char buf[bufSize];

  static const uint8_t period = 250;
  static elapsedMillis timer = period;

  if (timer >= period)
  {
    timer = 0;
    snprintf(buf, bufSize, "%d", (int)(analogRead(PIN_THERMO_ADC)));
    buf[bufSize-1] = 0;
    gwinSetText(ghLabel, buf, TRUE);
  }
  gfxYield();
}
I have verified that the label displays the ADC values correctly. Does anyone have an idea what could be wrong here?

Edit: I have no connection between ground and mains earth. Should I?
 
Last edited:
Here are two pictures of the hardware. The bottom part contains all high-voltage components, namely an the 5V power supply, an SSR with its LED input connected to Teensy 3.1 pin 3, and an optocoupler (SFH620A-3) with its collector connected to pin 2 and a pullup to 5V:
DSC_0285.jpg
Flat cable signals:
Code:
 GND 0  1 5V
opto 2  3 SSR
  nc 4  5 nc
  nc 6  7 nc
  nc x  9 nc
The flat cable goes to the top part. It's not connected in the picture below; the flat cable you see there goes to a display.
DSC_0284.jpg
All my ground connections directly go to the male header that connects to the bottom part. Same for 5V. VUSB is routed to that single pin next to the header so that I can use a jumper to connect 5V to VUSB when the flat cable is not attached. The top part can then operate without the bottom part.

The thermocouple amplifier is at the top right. The IC next to that is an analog multiplexer, but it is not connected to the Teensy and is passive. The thermocouple (white and green wire) is directly connected to the amplifier. There is a 1M pulldown to ground on the thermocouple's negative wire. The amplifier's output goes to A9.
 
Status
Not open for further replies.
Back
Top