This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can't get a valid data from ADS1115.

Other Parts Discussed in Thread: ADS1115, ADS1015

Hey guys,

I have a problem about the ADS1115 connect to Arduino UNO board.
I follow the "Assembly and Wiring" on https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/assembly-and-wiring


I went to read voltage from Arduino but I got output of "-1" always.

1
2
3
4
5
6
7
8
9
AIN0: -1
 
AIN0: -1
 
AIN0: -1
 
AIN0: -1
 
AIN0: -1

I've searched on several forums, however, I stiil don't know what happen?
I've tested 4 different ADS1115 which also given me "-1" value.

Code  as follows.
Arduino's library of ADS1115 from Adafruit  on https://github.com/adafruit/Adafruit_ADS1X15

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <Wire.h>
#include <Adafruit_ADS1015.h>
 
Adafruit_ADS1115 ads;
 
void setup(void)
{
  Serial.begin(9600);
  Serial.println("Hello!");
  
  Serial.println("Getting single-ended readings from AIN0..3");
  Serial.println("ADC Range: +/- 6.144V ((1 bit = 3mV/ADS1015, 0.1875mV/ADS1115)")");
  ads.begin();
}
 
void loop(void)
{
  int16_t adc0;
 
  adc0 = ads.readADC_SingleEnded(0);
  Serial.print("AIN0: ");
  Serial.println(adc0);
  Serial.println(" ");
  
  delay(1000);
}

  • Hi,


    I'm not entirely sure of what the problem is, but I suspect the readout of the device is a problem. If the device does not understand the proper I2C address, then the device might not acknowledge the command. If you're reading out the data, and the device doesn't respond, you might get all 1's.

    First, I would check the setting of the ADDR pin and compare that with the settings given in Table 4 on page 23 of the datasheet. Then I would use either an oscilloscope, or logic analyzer to look at the I2C communication.

    In the data read back, get the scope shot of the communications and post it back here. It should look like Figure 30 on page 24 in the datasheet. In particular you want to see that the device acknowledges the communication after each byte.

    You can also check this communication with a read back of the configuration register and I'd also check the register values that you're trying to write to and read from. However, get the oscilloscope to check the communications, and compare them with Figure 30 and 31 in the datasheet to see that the device is responding.


    Joseph Wu