ESP32: and ADS1115

Hi
using the ADS-1115-WE library I am currently getting the value of 6.144v (the max) on every analog input to this sensor. Measured values are closer to 2.854 on one input and 3.252 on another. the other two inputs being floating.

is this a known behaviour for the chip?

VCC is around 5.1v. plenty of juice, no brownouts. i2c lines are properly pulled up.

thanks

Could you post a schematic showing how it is wired, powered and links to technical information on the hardware devices, azon is generally sales data not technical information. A frizzy picture will not help much. Is your meter in calibration, your readings are out of specification.

attached is the schematic. it is powered from 13v from a large VFD regulated to 5v via a buck converter. there is no problem with the power supply.

here is the datasheet

here is the link to the library

the ESP32 is a bare wroom32.

multimeter calibration is not relevant here. the ADC is returning the same value for all inputs, even when two are floating and a third is connected to a 3.3v regulated line. the ADC is returning the maximum permitted voltage.

this looks much more likely to be a library or known chip error.

When the IP to the ADC is grounded what is the return value?

The ADS1115, does it output 5V? I ask because the ESP32 is not 5V tolerant.

Ads1115 has programmable gain control of up to 16x. If that was configured with a high gain, input voltages around 2.8~3.2V might be reported as 6.1V because that's the maximum it can report?

apologies, the code snip was not pasted. here it is

void setupADC() {
  Wire.begin(sda, scl);
  if (!adc.init()) {
    Serial.println("ADS1115 not connected!");
  } else {
    Serial.println("ADC initialised");
  }
}


uint16_t getPH() {
  float phVoltage = 0.0;
  float vcc = 0.0;
  float phVoltage1 = readChannel(ADS1115_COMP_0_GND);
  phVoltage = readChannel(ADS1115_COMP_0_3);
  vcc = readChannel(ADS1115_COMP_3_GND);
  Serial.printf("measured ph voltage: %0.3f\n", phVoltage1);
  Serial.printf("measured ph voltage delta: %0.3f\n", phVoltage);
  Serial.printf("measured VCC: %0.3f\n", vcc);

  StaticJsonDocument<200> doc;
  doc["ph"] = phVoltage1;
  doc["delta"] = phVoltage;
  doc["vcc"] = vcc;

  String buff;
  serializeJson(doc, buff);
  ws.textAll(buff.c_str());

  return phVoltage;
}


float readChannel(ADS1115_MUX channel) {
  float voltage = 0.0;
  adc.setVoltageRange_mV(ADS1115_RANGE_6144);
  adc.setCompareChannels(channel);
  adc.startSingleMeasurement();
  while (adc.isBusy()) {}
  delay(1000);
  voltage = adc.getResult_V(); // alternative: getResult_mV for Millivolt
  return voltage;
}

the I2C lines are pulled up to 3.3v. there is no 5v signal going to the ESP32 but just FYI the ESP32 GPIOs are 5v tolerant.

@jpadie you posted in the wrong section, please read the description of where you originally posted to see it was not for your project, this post is clearly about your project so I have moved it here.