- Fri Feb 10, 2017 6:43 pm
#193354
Hello,
I'm simply trying to read a voltage divider. The connections are:
Arduino to ADS1115:
A4 --> SDA
A5 --> SCL
Other ADS1115 Connections:
VDD --> 5V
GND --> GND
A0 --> Voltage divider
The code is right from the Adafruit site. I only changed a few applicable labels from ads1015 to ads1115. The code uploads and the serial monitor gives me:
Hello!
Getting single-ended readings from AIN0..3
ADC Range: +/- 6.144V (1 bit = 188uV)
AIN0: -1
AIN1: -1
AIN2: -1
AIN3: -1
AIN0: -1
AIN1: -1
AIN2: -1
AIN3: -1
AIN0: -1
AIN1: -1
AIN2: -1
AIN3: -1
It just keeps reporting -1 for all four channels! The code is:
https://learn.adafruit.com/adafruit-4-c ... and-wiring
Do I need to tell the Arduino which pins are SDA, SCL because the Pro Mini doesn't have dedicated SDA, SCL pins?
I read on another forum that a "-1" may mean that is has timed out.
It basically seems like it's not responding. Any thoughts?!
I'm simply trying to read a voltage divider. The connections are:
Arduino to ADS1115:
A4 --> SDA
A5 --> SCL
Other ADS1115 Connections:
VDD --> 5V
GND --> GND
A0 --> Voltage divider
The code is right from the Adafruit site. I only changed a few applicable labels from ads1015 to ads1115. The code uploads and the serial monitor gives me:
Hello!
Getting single-ended readings from AIN0..3
ADC Range: +/- 6.144V (1 bit = 188uV)
AIN0: -1
AIN1: -1
AIN2: -1
AIN3: -1
AIN0: -1
AIN1: -1
AIN2: -1
AIN3: -1
AIN0: -1
AIN1: -1
AIN2: -1
AIN3: -1
It just keeps reporting -1 for all four channels! The code is:
Code: Select all
I wired it as is shown here and I have a single wire going from A0 to a voltage divider:#include <Wire.h>
#include <Adafruit_ADS1015.h>
Adafruit_ADS1115 ads1115(0x48);
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 = 188uV)");
ads1115.begin();
Wire.begin();
}
void loop(void)
{
int16_t adc0, adc1, adc2, adc3;
adc0 = ads1115.readADC_SingleEnded(0);
adc1 = ads1115.readADC_SingleEnded(1);
adc2 = ads1115.readADC_SingleEnded(2);
adc3 = ads1115.readADC_SingleEnded(3);
Serial.print("AIN0: "); Serial.println(adc0);
Serial.print("AIN1: "); Serial.println(adc1);
Serial.print("AIN2: "); Serial.println(adc2);
Serial.print("AIN3: "); Serial.println(adc3);
Serial.println(" ");
delay(1000);
}
https://learn.adafruit.com/adafruit-4-c ... and-wiring
Do I need to tell the Arduino which pins are SDA, SCL because the Pro Mini doesn't have dedicated SDA, SCL pins?
I read on another forum that a "-1" may mean that is has timed out.
It basically seems like it's not responding. Any thoughts?!