Can't get the ADS1115 board to work

I have an NCD ADS1115 single input board and can’t get valid readings from the board. I’ve added a NCD power isolator inbetween my photon and the ADS1115 board. I do not have an external power supply connected to my 4-20mA loop.

My configuration is simple, I have a 4-20mA pressure transmitter connected to the two terminals of the ADS1115 input board. When I do not have a transmitter connected, I am receiving -4138 as a reading. If I connect my pressure transmitter to the terminals (no pressure applied, so 0psi = 4mA - verified with a meter) I see 26112.

These readings are being taken using the code provided on github (below for reference).

These readings don’t make any sense because this would be 7562 per mA (which would require a total of 121,000 bits where 0mA is at the -4138 mark and there would therefore be no way to achieve the full 4-20mA range.

Am I doing something wrong? Was I supposed to change a gain value somewhere?

Any help is appreciated!

// Distributed with a free-will license.
// Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
// ADS1115
// This code is designed to work with the ADS1115_I2CADC I2C Mini Module available from ControlEverything.com.
// https://www.controleverything.com/content/Analog-Digital-Converters?sku=ADS1115_I2CADC#tabs-0-product_tabset-2

#include <application.h>
#include <spark_wiring_i2c.h>

// ADS1115 I2C address is 0x48(72)
#define Addr 0x48

int raw_adc = 0;
void setup()
{
// Set variable
Particle.variable(“i2cdevice”, “ADS1115”);
Particle.variable(“raw_adc”, raw_adc);

// Initialise I2C communication as MASTER
Wire.begin();
// Initialise Serial Communication, set baud rate = 9600
Serial.begin(9600);

// Start I2C Transmission
Wire.beginTransmission(Addr);
// Select configuration register
Wire.write(0x01);
// AINP = AIN0 and AINN = AIN1, +/- 2.048V
Wire.write(0x84);
// Continuous conversion mode, 128 SPS
Wire.write(0x83);
// Stop I2C Transmission
Wire.endTransmission();
delay(300);
}

void loop()
{
unsigned int data[2];

// Start I2C Transmission
Wire.beginTransmission(Addr);
// Select data register
Wire.write(0x00);
// Stop I2C Transmission
Wire.endTransmission();

// Request 2 bytes of data
Wire.requestFrom(Addr, 2);

// Read 2 bytes of data
// raw_adc msb, raw_adc lsb
if (Wire.available() == 2)
{
data[0] = Wire.read();
data[1] = Wire.read();
}

// Convert the data
int raw_adc = (data[0] * 256.0) + data[1];
if (raw_adc > 32767)
{
raw_adc -= 65535;
}

// Output data to dashboard
Particle.publish(“Digital Value of Analog Input :”, String(raw_adc));
delay(1000);
}

Hi,
try this lib

Thanks

Thanks for the quick response! I have tried this library as well, with the addition of only one line of code so I can view the results in the particle console:

I added the following between Lines 16 and 17, but it should not have impacted the readings:
Particle.publish(“Reading:”, String(ma));

The readings I see are:

With no transmitter connected I am reading .078873
With the transmitter connected at 0psi I see 39.954929

whats the part number of the transmitter ?
Try this-- swap the transmitter wires and see what readings you get. ( do this for just a couple of seconds).

Thanks

The P/N is SPTD25-20-0100H. The datasheet can be found here:

I have tried reversing the leads momentarily and there is no change in the reading, it continues to act as if there is no transmitter connected.

If I connect the leads correctly (brown wire to IN and white wire to GND), if I connect an ammeter in series, I read 4.00mA on the meter.

In past there was one more user who had similar sensor
https://forum.ncd.io/content/4-20ma-Receiver-Help

You can check the wiring and their setup over here.
Looks like your sensor will need external power supply as well.
Let me know what you find out.

Thanks