2

I'm using a ADS1113 delta-sigma 16-bit ADC to sample a bipolar signal from a force sensor at 50Hz, and I have found a weird phenomenon.

When the signal negative or positive, there is no issue, but when the signal crosses over zero, the signal seem to be held in place for a bit before the sampling continues as seen below (and even weirder it's not always at 0, just near 0):

enter image description here

enter image description here

enter image description here

I have checked the analog signal on an oscilloscope and this does not happen, it only happens when I digitize the signal using ADS1113, and plot the results. I could adjust the bias of the signal such that the signal is positive or negative, but because of the dynamic range of the signal, this cannot be guaranteed always. Has anyone faced this issue? It seems like a sample & hold issue of some sort, but I cannot find any solution. Any comments or suggestions are greatly appreciated, thanks!

Settings: MCU: ESP32WROOM - uses interrupt routine to request single-shot data from ADS1113 ADS1113 settings: single-shot mode (as defined by aAdafruit_ADS1X151 library)

AFE + ADS1113 circuit schematic: enter image description here

int16_t Adafruit_ADS1X15::readADC_SingleEnded(uint8_t channel) {
  if (channel > 3) {
    return 0;
  }

  // Start with default values
  uint16_t config =
      ADS1X15_REG_CONFIG_CQUE_NONE |    // Disable the comparator (default val)
      ADS1X15_REG_CONFIG_CLAT_NONLAT |  // Non-latching (default val)
      // ADS1X15_REG_CONFIG_CLAT_LATCH |
      ADS1X15_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low   (default val)
      ADS1X15_REG_CONFIG_CMODE_TRAD |   // Traditional comparator (default val)
      // ADS1X15_REG_CONFIG_CMODE_WINDOW |
      ADS1X15_REG_CONFIG_MODE_SINGLE;   // Single-shot mode (default)
      // ADS1X15_REG_CONFIG_MODE_CONTIN;

  // Set PGA/voltage range
  config |= m_gain;

  // Set data rate
  config |= m_dataRate;

  // Set single-ended input channel
  switch (channel) {
  case (0):
    config |= ADS1X15_REG_CONFIG_MUX_SINGLE_0;
    break;
  case (1):
    config |= ADS1X15_REG_CONFIG_MUX_SINGLE_1;
    break;
  case (2):
    config |= ADS1X15_REG_CONFIG_MUX_SINGLE_2;
    break;
  case (3):
    config |= ADS1X15_REG_CONFIG_MUX_SINGLE_3;
    break;
  }

  // Set 'start single-conversion' bit
  config |= ADS1X15_REG_CONFIG_OS_SINGLE;

  // Write config register to the ADC
  writeRegister(ADS1X15_REG_POINTER_CONFIG, config);

  // Wait for the conversion to complete
  while (!conversionComplete())
    ;

  // Read the conversion results
  return getLastConversionResults();
}
June
  • 23
  • 4
  • 1
    Also you say you're measuring a bipolar signal, but your code shows a single-ended measurement. Single-ended means AINN connected to ground, and this ADC cannot measure voltages that are negative wrt ground. – DamienD May 12 '22 at 07:55
  • I have added the circuit schematic above. According to datasheet ADS1113 has +/-2V range, which allows for measurement of negative voltages. Also, when I push the voltage more negative (by turning off DAC whic is currently giving it positive bias), I'm able to measure negative voltages fine, but the same issue occurs when the negative voltage tries to cross over 0V – June May 12 '22 at 08:00
  • I connected the same output (OUT2 in schematic above) to a SDADC set on STM32F373, and it does not show the saturation when crossing zeros as seen above with ADS1113... Is there some setting I could've missed? – June May 12 '22 at 08:05
  • Look at table 7.3: the absolute input voltage cannot go below GND. – DamienD May 12 '22 at 08:06
  • Ah I see... I interpretted 'FSR = +/-2.048V' as being able to measure negative voltages. Any ideas on how ADS was able to capture negative voltages? is it possible that it operates under 0V but the performance is not guaranteed? – June May 12 '22 at 08:14
  • Most likely you're seeing clipping by the ESD protection diodes and operation in that range is completely unspecified (it could also damage the device) – DamienD May 12 '22 at 08:17

1 Answers1

2

According to the datasheet, the ADS1113 cannot measure voltages that are negative with respect to ground (table 7.3).

It also doesn't have an input multiplexer (the ADS1115 does, cf. section 9.3.1), so the "single-ended" configuration option will have no effect. You need to connect both AIN0 and AIN1 to either a bipolar signal, or a single-ended signal and ground. In either case the inputs can't be negative wrt ground.

DamienD
  • 3,093
  • 1
  • 14
  • 23
  • I fully agree. I think the confusion comes from the fact that is states "FSR ±2.048 V" etc. Why does it state a FSR that is both positive and negative?`What does this mean in this context, when the input is not allowed to be negative? – Linkyyy May 12 '22 at 08:16
  • 2
    @Linkyyy AIN1 can be negative with respect to AIN0 and vice versa, just not with respect to ground. – DamienD May 12 '22 at 08:20
  • 1
    thanks for the quick answer, much appreciated!! – June May 12 '22 at 08:24
  • 1
    @DamienD, aha thanks. That makes sense. – Linkyyy May 12 '22 at 08:25