SPX-16770 Qwiic PT100 ADS122C04 open circuit detection and external connectors

Hi! I’m trying to build a portable temperature sensor with a 3-wire PT100 detachable probe using the SPX-16770 to read it. I had a few questions that I couldn’t quite figure out based on the information available.

  1. Is hot-plugging a probe a Bad Idea for the SPX-16770? Is there anything I should attach to the inputs to protect the ADC from letting its magic smoke out?

  2. How do I detect when a probe isn’t connected? Connecting the sensor board without any probe attached, I get obviously nonsensical temperature values (~ -600C, way outside the probe’s range). Would that be a reliable way to check for disconnected inputs?

  3. Would using an audio connector (TRRS) to connect a probe cause issues? I’m thinking of mapping the two signals on the same side of the sensor to the tip and ring 1, with the single return wire going on ring 2. Shield will be connected to ground. I’m slightly worried about shorting things as the plug is inserted (which is why I wanted to put the return signal last).

Happy to provide more details if needed. Thanks!

Hi Sean,

I’ll try to answer your questions but you will need to try some tests / experiments yourself.

  1. The ADS122C04 is rated for 2000/750V ESD. And looking at Figure 42 in the datasheet, there are already ESD clamp diodes on all inputs, to AVDD and AVSS. Adding more ESD or input protection doesn’t seem necessary?

  2. When configured for PT100, the ADS passes a constant current through the sensor and the 1620 Ohm precision resistor. If the probe is not connected you will, I think, see a high level at AIN1 and a low level (~0V) at AIN2. There will also be essentially zero voltage across REFP and REFN. I suggest configuring the chip to leave the constant current enabled and then read the REF differential voltage directly. If that’s ~zero then you know the probe is disconnected.

  3. Using an audio jack seems a sensible idea. I don’t think the contact resistance will cause any major difficulties, but you will need to test it to be sure. A direct short from pin 2 to pin 3 can’t damage anything, but you will see erroneous readings while you plug and unplug.

Good luck with your project!

Best wishes,

Paul

Thanks for the pointers! I played around with this today with a simple test program, and got results sorta close to what you were predicting.

## key ##
V = rtd.readRawVoltage() / 4096.0
adc = rtd.readADC()
temp = rtd.readPT100Centigrade()

V = -0.43 adc = FFF92B temp = -675.71  # probe disconnected at start
V = -0.44 adc = FFF8FC temp = -677.85
V = -0.47 adc = FFF86E temp = -685.54
V = -0.41 adc = FFF95E temp = -682.58
V = -0.41 adc = FFF969 temp = -677.68
V = -0.42 adc = FFF943 temp = -565.86
V = -0.41 adc = FFF966 temp = -614.40
V = -0.41 adc = FFF968 temp = -697.76
V = -0.12 adc = FFFE15 temp = -632.07  # lead 4 connected
V = 2048.00 adc = 7FFFFF temp = 900.11 # lead 3 connected
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 0.07 adc = 112 temp = 23.00        # lead 2 connected
V = 0.06 adc = EB temp = 22.95
V = 0.06 adc = F1 temp = 22.95
V = 0.06 adc = E3 temp = 22.95
V = 0.05 adc = D2 temp = 22.95
V = 0.05 adc = CD temp = 22.95
V = 0.05 adc = B9 temp = 22.94
V = 0.06 adc = 108 temp = 22.95
V = 0.05 adc = D3 temp = 22.95
V = 0.05 adc = C8 temp = 22.95
V = 0.05 adc = CF temp = 22.95
V = 0.06 adc = F6 temp = 22.95
V = 0.06 adc = FC temp = 22.94
V = 0.05 adc = C1 temp = 22.95
V = 0.07 adc = 119 temp = 23.46
V = 0.05 adc = C6 temp = 23.51
V = 0.05 adc = C9 temp = 23.40
V = 2048.00 adc = 7FFFFF temp = 900.11 # lead 2 disconnected
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = 2048.00 adc = 7FFFFF temp = 900.11
V = -0.35 adc = FFFA58 temp = 612.54   # leads 3 & 4 disconnected
V = 5.56 adc = 5904 temp = -571.73
V = -0.33 adc = FFFAAE temp = -676.52
V = -0.37 adc = FFFA1E temp = -704.38
V = -0.37 adc = FFFA0D temp = -652.69
V = -0.38 adc = FFF9E5 temp = -692.33
V = -0.37 adc = FFFA26 temp = -670.56

I used the ADS122C04_MUX_REFPmREFN input mux setting to get the reference voltage monitor (and then restored the mux setting before asking for the temperature reading). Playing around with gain, PGA, and reference settings didn’t seem to change the values any (probably are disregarded for this mux setting).

Based on this, I think if the reference monitor dips below 0, the probe is probably disconnected; anything positive, and it’s likely connected to at least one leg on the opposite side. Seems reasonable?

Would this be a useful feature to make a PR for the SparkFun library?

Oh, right, would probably help if I posted the sketch I used:

#include <Arduino.h>
#include <SparkFun_ADS122C04_ADC_Arduino_Library.h>
#include <Wire.h>

#ifdef ARDUINO_ARCH_RP2040
#define WIRE Wire1
#else
#define WIRE Wire
#endif

const int ADS122C04_ADDR = 0x45;

SFE_ADS122C04 rtd;

bool rtd_connected = false;

int32_t raw_voltage = 0;
uint32_t raw_adc = 0;

void readDiffRef() {
  
  // Get old settings
  uint8_t oldMux = rtd.getInputMultiplexer();

  // Set input mux to read differnce across reference
  rtd.setInputMultiplexer(ADS122C04_MUX_REFPmREFN);

  // Get ADC value
  raw_voltage = rtd.readRawVoltage();
  raw_adc = rtd.readADC();

  // Restore old settings
  rtd.setInputMultiplexer(oldMux);

}

void setup() {
  
  Serial.begin(115200);
  while (!Serial)
    ;

  WIRE.begin();

  // Check if device is connected on i2c bus
  if (!rtd.begin(ADS122C04_ADDR, WIRE)) {
    Serial.println("ADS122C04 NOT found!");

  // If found, setup for 3 wire PT100 mode
  } else {
    Serial.println("ADS122C04 found");
    rtd_connected = true;
    rtd.configureADCmode(ADS122C04_3WIRE_MODE);
  }

}

void loop() {
  if (rtd_connected) {

    readDiffRef();
    float raw = raw_voltage / 4096.0;
    uint32_t adc = raw_adc;

    float temp = rtd.readPT100Centigrade();

    Serial.print("V = ");
    Serial.print(raw);
    Serial.print(" adc = ");
    Serial.print(adc, HEX);
    Serial.print(" temp = ");
    Serial.println(temp, 2);

    delay(1000);

  }
}

Hi Sean,

I’m glad that’s working for you. I’ll add a link to this discussion on the product GitHub page.

Best wishes,

Paul