The ADS1115 is a high-precision 16-bit analog-to-digital converter (ADC) with an I2C interface. It is capable of measuring up to four single-ended inputs or two differential inputs, making it ideal for applications requiring accurate sensor data acquisition. The ADS1115 features a programmable gain amplifier (PGA) and operates with low power consumption, making it suitable for battery-powered devices.
The ADS1115 is available in an 8-pin package. Below is the pinout and description:
Pin Number | Pin Name | Description |
---|---|---|
1 | VDD | Power supply input (2.0V to 5.5V). |
2 | GND | Ground reference. |
3 | SCL | I2C clock line. Connect to the microcontroller's I2C clock pin. |
4 | SDA | I2C data line. Connect to the microcontroller's I2C data pin. |
5 | ALERT/RDY | Configurable as an alert pin or ready signal output. |
6 | A0 | I2C address selection pin (connect to GND, VDD, or float for address setup). |
7 | A1 | I2C address selection pin (connect to GND, VDD, or float for address setup). |
8 | IN0-IN3 | Analog input pins for single-ended or differential measurements. |
Below is an example of how to use the ADS1115 with an Arduino UNO to read a single-ended input:
#include <Wire.h>
#include <Adafruit_ADS1X15.h>
// Create an ADS1115 object
Adafruit_ADS1115 ads;
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
if (!ads.begin()) {
Serial.println("Failed to initialize ADS1115! Check connections.");
while (1); // Halt execution if initialization fails
}
Serial.println("ADS1115 initialized successfully.");
}
void loop() {
int16_t adc0; // Variable to store ADC reading from channel 0
// Read the analog value from channel 0
adc0 = ads.readADC_SingleEnded(0);
// Convert the raw ADC value to voltage (assuming default gain ±6.144V)
float voltage = adc0 * 0.1875 / 1000; // 0.1875mV per bit for default gain
// Print the ADC value and corresponding voltage
Serial.print("ADC Value: ");
Serial.print(adc0);
Serial.print(" | Voltage: ");
Serial.print(voltage, 4); // Print voltage with 4 decimal places
Serial.println(" V");
delay(1000); // Wait for 1 second before the next reading
}
No I2C Communication:
Incorrect or Unstable Readings:
ADS1115 Not Detected:
Q: Can I use the ADS1115 with a 3.3V microcontroller?
A: Yes, the ADS1115 is compatible with 3.3V systems. Ensure the VDD pin is supplied with 3.3V, and the I2C lines are pulled up to 3.3V.
Q: How do I measure differential signals?
A: Connect the positive signal to one input pin (e.g., IN0) and the negative signal to another input pin (e.g., IN1). Configure the ADS1115 to read the differential pair in your code.
Q: What is the maximum sampling rate of the ADS1115?
A: The maximum sampling rate is 860 samples per second (SPS). You can configure the data rate in the code to suit your application.
Q: Can I connect multiple ADS1115 devices to the same I2C bus?
A: Yes, you can connect up to four ADS1115 devices by configuring the A0 and A1 pins to set unique I2C addresses.