I am trying to use the Adafruit ADS1115 16-bit ADC module with an Arduino due, and I2C communication seems to fail. Readout of the analog values gives inconsistent values. When I perform a read operation, I get a value which seems to be determined by the previous read operation. For instance if I read out channels 0, 1, 2 and 3 in sequence the read of channel 1 is determined by the voltage on channel 0, the read of channel 2 is determined by the voltage on channel 1, etc. I know the ADS1115 is not damaged and wired correctly because if I hook it up to an Adruino Leonardo in an identical manor, the same code runs fine and returns correct readings. (Both are compiled with IDE version 1.5.8) Adding pull-up resistors does not affect the behavior. The 3.3V logic levels of the Due should not be an issue since the ADS1115 breakout board is specified to work with power and logic levels between 2V and 5V.
I suspect incompatibility between the Adafruit library and the DUE wire library, which people seem to complain about. Anyone have experience trying to get the ADS1115 working with the Arduino Due?
I suspect you haven't driven the ADC with a sufficiently low impedance... With the Due the
device may be being accessed faster so there is less time between switching inputs and
starting a conversion. There is a maximum source impedance value for any particular
settling time between changing an input and converting it, as the sample/hold capacitor
on the ADC has to charge up fully to the source voltage. This is likely to depend on
the supply voltage too.
You could try introducing some delay between selecting source and starting a conversion
or alter the nature of the source to be low impedance.
For due, you'll need to change the ADS1115 library where Wire instance should be changed to Wire1.
I had to work it an i2c RTC earlier and that fixed the problem. Wire is for AVR, Wire1 is for ARM.
me too i use an ads1115 with an arduino Due, i have download the library , i don't have a syntax error, but the result is always 0 for all the outputs (ANO->AN3), i tried the differential mode between AN0 and AN1, but the result is the same 0.