# Adafruit 4-Channel ADC Breakouts

## Overview

![ADS1115](https://cdn-shop.adafruit.com/970x728/1085-14.jpg )

![ADS1015](https://cdn-shop.adafruit.com/970x728/1083-11.jpg )

The ADS1115 and ADS1015 4-channel breakout boards are perfect for adding high-resolution analog to digital conversion to any microprocessor-based project. &nbsp;These boards can run with power and logic signals between 2v to 5v, so they are compatible with all common 3.3v and 5v processors. &nbsp;As many of 4 of these boards can be controlled from the same 2-wire I2C bus, giving you up to 16 single-ended or 8 differential channels. &nbsp;A programmable gain amplifier provides up to x16 gain for small signals.  
  
These two boards are very similar, differing only in resolution and speed. The ADS1115 provides 16-bit precision at 860 samples/second, while the ADS1015 provides 12-bit precision at 3300 samples/second.

![stemma](https://cdn-shop.adafruit.com/970x728/1085-13.jpg )

To get you going fast, we spun up a custom-made PCB in the[&nbsp; **STEMMA QT** &nbsp;form factor](https://www.adafruit.com/?q=stemma%20qt%20sensor "STEMMA QT form factor"), making it easy to interface with. The&nbsp;[STEMMA QT connectors](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt)&nbsp;on either side are compatible with the&nbsp;[SparkFun Qwiic](https://www.sparkfun.com/qwiic) I2C connectors. This allows you to make solderless connections between your development board and either the ADS1115 or ADS1015. You can chain the boards with a wide range of other sensors and accessories using a [**compatible cable**](https://www.adafruit.com/?q=stemma%20qt%20cable).

![ADS1115](https://cdn-shop.adafruit.com/970x728/1085-09.jpg )

## ADS1115 Features:

- WIDE SUPPLY RANGE: 2.0V to 5.5V
- LOW CURRENT CONSUMPTION: Continuous Mode: Only 150µA Single-Shot Mode: Auto Shut-Down
- PROGRAMMABLE DATA RATE: 8SPS to 860SPS
- INTERNAL LOW-DRIFT VOLTAGE REFERENCE
- INTERNAL OSCILLATOR
- INTERNAL PGA
- I2C INTERFACE: Pin-Selectable Addresses
- FOUR SINGLE-ENDED OR TWO DIFFERENTIAL INPUTS
- PROGRAMMABLE COMPARATOR
- This board/chip uses I2C 7-bit addresses between 0x48-0x4B, selectable with jumpers

![ADS1015](https://cdn-shop.adafruit.com/970x728/1083-06.jpg )

## ADS1015&nbsp;Features:

- WIDE SUPPLY RANGE: 2.0V to 5.5V
- LOW CURRENT CONSUMPTION: Continuous Mode: Only 150µA Single-Shot Mode: Auto Shut-Down
- PROGRAMMABLE DATA RATE: 128SPS to 3.3kSPS
- INTERNAL LOW-DRIFT VOLTAGE REFERENCE
- INTERNAL OSCILLATOR
- INTERNAL PGA
- I2C INTERFACE: Pin-Selectable Addresses
- FOUR SINGLE-ENDED OR TWO DIFFERENTIAL INPUTS
- PROGRAMMABLE COMPARATOR
- This board/chip uses I2C 7-bit addresses between 0x48-0x4B, selectable with jumpers

![](https://cdn-learn.adafruit.com/assets/assets/000/112/695/medium800/arduino_compatibles_bothTopAngle.png?1656446236)

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/112/694/medium800/arduino_compatibles_sensors_2012_11_10_IMG_0756-1024.jpg?1656445789)

# Adafruit 4-Channel ADC Breakouts

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/112/696/medium800/arduino_compatibles_front_backads1115.png?1656446850)

![](https://cdn-learn.adafruit.com/assets/assets/000/112/697/medium800/arduino_compatibles_front_backADS1015.png?1656446860)

The default I2C address is **0x48**.

## Power Pins

The ADC on the breakout requires between 2V to 5V power/logic, and can be easily used with most microcontrollers from an Arduino to a Feather or something else.

- **VIN** &nbsp;- this is the power pin. Acceptable voltages are 2V to 5V. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V.&nbsp;
- **GND** &nbsp;- common ground for power and logic

## I2C Logic Pins

- **SCL&nbsp;** - I2C clock pin, connect to your microcontroller's I2C clock line. This pin has&nbsp; a&nbsp; **10K pullup** &nbsp;to VIN
- **SDA&nbsp;** -I2C data pin, connect to your microcontroller's I2C data line.&nbsp;This pin has&nbsp; a&nbsp; **10K pullup** &nbsp;to VIN.
- [**STEMMA QT**](https://learn.adafruit.com/introducing-adafruit-stemma-qt) **&nbsp;-&nbsp;** These connectors allow you to connect to development boards with&nbsp; **STEMMA QT** &nbsp;connectors, or to other things, with[&nbsp;various associated accessories](https://www.adafruit.com/?q=JST%20SH%204).

## Address Jumper

On the back of the board is **one address jumper** , labeled **A0**** , **below&nbsp;the&nbsp;** I2C Addr**&nbsp;label on the board silk. This jumper allows you to chain up to 2 of these boards on the same pair of I2C clock and data pins. To do so, you solder the jumper "closed" by connecting the two pads.

The default I2C address is&nbsp; **0x48**. The other address options can be calculated by “adding” the&nbsp; **A0** to the base of&nbsp; **0x48**.

**A0** &nbsp;sets the lowest bit with a value of&nbsp; **1**. **&nbsp;** The final address is&nbsp; **0x48 + A0** &nbsp;which would be&nbsp; **0x49**.

 If&nbsp; **A**** 0 **&nbsp;is soldered closed, the address is&nbsp;** 0x48 + 1 = 0x49**

The table below shows all possible addresses, and whether the pin(s) should be high (closed) or low (open).

![](https://cdn-learn.adafruit.com/assets/assets/000/112/698/medium800/arduino_compatibles_i2cAddress.png?1656447781)

## Address Pin

- **ADDR** - I2C address selection pin.

The ADS11x5 chips have a base 7-bit I2C address of 0x48 (1001000) and a clever addressing scheme that allows four different addresses using just one address pin (named **ADDR** for ADdRess). To program the address, connect the address pin as follows:

![](https://cdn-learn.adafruit.com/assets/assets/000/112/699/medium800/arduino_compatibles_addrPin.png?1656448444)

## Other Pins

- **ALRT** - Digital comparator output or conversion ready, can be set up and used for interrupt / asynchronous read.
- **A+** and **A-** - ADC power supply (VIN through a ferrite) and ADC ground (digital GND through a ferrite) these are OUTPUTs not inputs!
- **A0, A1, A2, A3** &nbsp;- ADC input pins for each channel.

## Power LED and Jumper

- **Power LED -&nbsp;** In the upper left corner, above the STEMMA connector, on the front of the board, is the power LED, labeled **&nbsp;on**. It is the green LED.
- **LED jumper** &nbsp;- In the upper right corner on the back of the board is a jumper for the power LED. If you wish to disable the power LED, simply cut the trace on this jumper.

# Adafruit 4-Channel ADC Breakouts

## Assembly and Wiring

# Assembly:
The board comes with all surface-mount parts pre-soldered. &nbsp;For breadboard use, the included header-strip should be soldered on:## Prepare the header strip
Cut the supplied header strip to length and insert it long-pins-down in your breadboard to hold it for soldering.![sensors_2012_11_10_IMG_0757-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/576/medium640/sensors_2012_11_10_IMG_0757-1024.jpg?1396784735)

## Position the breakout&nbsp;board
Place the breakout board on the header pins.![sensors_2012_11_10_IMG_0759-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/577/medium640/sensors_2012_11_10_IMG_0759-1024.jpg?1396784744)

## Solder!
Solder each pin for a good electrical connection.  
![sensors_2012_11_10_IMG_0761-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/578/medium640/sensors_2012_11_10_IMG_0761-1024.jpg?1396784751)

# Wiring:

## Power
First connect VDD and GND. &nbsp;These boards will work with either a 3.3v or a 5v supply. &nbsp;The diagram below shows connection to the Arduino 5v pin.  
Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/002/673/medium800/sensors_ADC_Power_bb-1024.jpg?1396785683)

## I2C Connections
I2C requires just 2 pins to communicate. &nbsp;These can be shared with other I2C devices. &nbsp;For R3 and later Arduinos (including MEGA and DUE models), connect SDA-\>SDA and SCL-\>SCL.![](https://cdn-learn.adafruit.com/assets/assets/000/002/674/medium800/sensors_ADC_i2c_bb-1024.jpg?1396785691)

## I2C "Classic"
For older Arduino boards without dedicated SDA and SCL pins, connect as shown below. &nbsp;(For older Arduino Megas, SDA and SCL are on pins 20 and 21)![](https://cdn-learn.adafruit.com/assets/assets/000/002/675/medium800/sensors_ADC_Classic_i2c_bb-1024.jpg?1396785699)

## I2C Addressing

The ADS11x5 chips have a base 7-bit I2C address of 0x48 (1001000) and a clever addressing scheme that allows four different addresses using just one address pin (named **ADR** for ADdRess). To program the address, connect the address pin as follows:

![](https://cdn-learn.adafruit.com/assets/assets/000/112/700/medium800/arduino_compatibles_addrPin.png?1656448546)

The following diagram shows one board addressed as 0x48:

![](https://cdn-learn.adafruit.com/assets/assets/000/002/676/medium800/sensors_ADC_Address_0_bb-1024.jpg?1396785706)

## Multiple Boards
By assigning each board a different address, up to 4 boards can be connected as below:![](https://cdn-learn.adafruit.com/assets/assets/000/002/677/medium800/sensors_FourBoards_bb-1024.jpg?1396785716)

# Adafruit 4-Channel ADC Breakouts

## Signal Connections

![](https://cdn-learn.adafruit.com/assets/assets/000/002/680/medium800/sensors_ADS1015.jpg?1396785737)

## Single Ended vs. Differential Inputs:
The ADS1x15 breakouts support up to 4 SIngle Ended or 2 Differential inputs.  
  
**Single Ended** inputs measure the voltage between the analog input channel (A0-A3) and analog ground (GND).  
  
**Differential** inputs measure the voltage between two analog input channels. &nbsp;(A0&A1 or A2&A3).  
## Which should I use?
Single ended inputs give you twice as many inputs. So why would you want to use differential inputs?   
  
Single ended inputs can, by definition, only measure positive voltages. Without the sign bit, you only get an effective 15 bit resolution.  
  
In addition to providing the full 16 bits of resolution and the ability to measure negative voltages, Differential measurements offer more immunity from electromagnetic noise. This is useful when using long signal wires or operating in an electrically noisy environment. This is also desirable when dealing with small signals requiring high gain, since the gain will amplify the noise as well as the signal.  
## Single Ended Connections:
Connect the signal wire to one of the analog input channels (A0 - A3). &nbsp;Connect the ground wire to GND. &nbsp;This diagram shows how to connect an ADXL335 to for measurement of the X, Y and Z axis on analog channels A0, A1 and A2. ![](https://cdn-learn.adafruit.com/assets/assets/000/002/678/medium800/sensors_ADC_SingleEnded_bb-1024.jpg?1396785723)

## Differential Connections:

Differential measurements use a pair of input pins, either A0&A1 or A2&A3. &nbsp;The following diagram shows connections for differential measurement of the battery voltage on a LiPo charger board.

![](https://cdn-learn.adafruit.com/assets/assets/000/002/679/medium800/sensors_ADC_Differential_bb-1024.jpg?1396785730)

Danger: 

# Adafruit 4-Channel ADC Breakouts

## Python & CircuitPython

It's easy to use the ADS1115 and ADS1015 ADC with CircuitPython and the&nbsp;[Adafruit CircuitPython ADS1x15](https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15)&nbsp;module.&nbsp; This module allows you to easily write Python code that reads the analog input values.

You can use this ADC with any CircuitPython microcontroller board or with a computer that has GPIO and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

# CircuitPython Microcontroller Wiring

First wire up the ADC to your board exactly as shown on the previous pages for Arduino using an I2C interface. &nbsp;Here's an example of wiring a Feather M0 to the ADS1x15 with I2C:

- **Board 3V** **(red wire in STEMMA QT version)** to **ADS1x15 VDD -** Remember the&nbsp; **maximum input voltage** &nbsp;to any ADC channel cannot exceed this VDD 3V value!
- **Board GND** &nbsp;**(black wire in STEMMA QT version)** to&nbsp; **ADS1x15 GND**
- **Board SCL** &nbsp;**(yellow wire in STEMMA QT version)** to&nbsp; **ADS1x15 SCL**
- **Board SDA** &nbsp;**(blue wire in STEMMA QT version)** to&nbsp; **ADS1x15 SDA**

![arduino_compatibles_featherStemma_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/112/705/medium640/arduino_compatibles_featherStemma_bb.png?1656449710)

![arduino_compatibles_featherBB_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/112/706/medium640/arduino_compatibles_featherBB_bb.png?1656449724)

![arduino_compatibles_sensors_m0_ads1115.png](https://cdn-learn.adafruit.com/assets/assets/000/112/707/medium640/arduino_compatibles_sensors_m0_ads1115.png?1656449738)

# Python Computer Wiring
Since there's&nbsp;_dozens_&nbsp;of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms,&nbsp;[please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Here's the Raspberry Pi wired to the ADS1015 with I2C:

- **Pi 3V** &nbsp;**(red wire in STEMMA QT version)** to&nbsp; **ADS1x15 VDD -** Remember the&nbsp; **maximum input voltage** &nbsp;to any ADC channel cannot exceed this VDD 3V value!
- **Pi GND** &nbsp;**(black wire in STEMMA QT version)** to&nbsp; **ADS1x15 GND**
- **Pi SCL** &nbsp;**(yellow wire in STEMMA QT version)** to&nbsp; **ADS1x15 SCL**
- **Pi SDA** **(blue wire in STEMMA QT version)** to&nbsp; **ADS1x15 SDA**

![arduino_compatibles_piStemma_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/112/708/medium640/arduino_compatibles_piStemma_bb.png?1656449797)

![arduino_compatibles_piBreadboard_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/112/709/medium640/arduino_compatibles_piBreadboard_bb.png?1656449821)

![arduino_compatibles_sensors_raspi_ads1015_i2c_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/112/710/medium640/arduino_compatibles_sensors_raspi_ads1015_i2c_bb.png?1656449834)

# CircuitPython Installation of ADS1x15Library
Next you'll need to install the&nbsp;[Adafruit CircuitPython ADS1x15](https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15)&nbsp;library on your CircuitPython board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://github.com/adafruit/circuitpython/releases)&nbsp;for your board.

Next you'll need to install the necessary libraries&nbsp;to use the hardware--carefully follow the steps to find and install these libraries from&nbsp;[Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).&nbsp; For example the Circuit Playground Express guide has&nbsp;[a great page on how to install the library bundle](https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-libraries)&nbsp;for both express and non-express boards.

Remember for non-express boards like the Trinket M0, Gemma M0, and Feather/Metro M0 basic you'll need to manually install the necessary libraries from the bundle:

- **adafruit\_ads1x15**
- **adafruit\_bus\_device**

You can also download the&nbsp; **adafruit\_ads1x15** folder&nbsp;from&nbsp;[its releases page on Github](https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15/releases).

Before continuing make sure your board's lib folder or root filesystem has the&nbsp; **adafruit\_ads1x15** and **adafruit\_bus\_device**** &nbsp; **files and folders** &nbsp;**copied over.

Next&nbsp;[connect to the board's serial REPL&nbsp;](../../../../micropython-basics-how-to-load-micropython-on-a-board/serial-terminal)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

# Python Installation of ADS1x15 Library
You'll need to install the [Adafruit\_Blinka](https://github.com/adafruit/Adafruit_Blinka) library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3.&nbsp;[Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `sudo pip3 install adafruit-circuitpython-ads1x15`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

# CircuitPython & Python Usage

To demonstrate the usage of the ADC we will initialize it and read the ADC channel values interactively using the REPL. &nbsp;First&nbsp;run the following code to import the necessary modules and initialize the I2C bus:

```auto
import board
i2c = board.I2C()
```

Next, import the module for the board you are using. For the ADS1015, use:

```auto
from adafruit_ads1x15 import ADS1015, AnalogIn, ads1x15
```

 **OR** , for the ADS1115, use:

```auto
from adafruit_ads1x15 import ADS1115, AnalogIn, ads1x15
```

&nbsp;

The other imports needed are for the ADS1x15 library's version of `AnalogIn` and `ads1x15` for accessing `Pin` constants.

The ADS1x15 version of `AnalogIn` provides behavior similar to the [core AnalogIn library](https://learn.adafruit.com/circuitpython-essentials/circuitpython-analog-in), but is specific to the ADS1x15 ADC's.

OK, now we can actually create the ADC object. For the ADS1015, use:

```auto
ads = ADS1015(i2c)
```

 **OR** , for the ADS1115, use:

```auto
ads = ADS1115(i2c)
```

Now let's see how to get values from the board. You can use these boards in either single ended or differential mode. The usage for the two modes are slightly different, so we'll go over them separately.

## Single Ended Mode

For single ended mode we use AnalogIn to create the analog input channel, providing the ADC object and the pin to which the signal is attached. Here, we use pin A0:

```auto
chan = AnalogIn(ads, ads1x15.Pin.A0)
```

To set up additional channels, use the same syntax but provide a different pin.

Now you can read the raw value and voltage of the channel using either the the **value** or **voltage** property.

```
print(chan.value, chan.voltage)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/066/982/medium800/sensors_se_screen.jpg?1543875955)

Danger: NOTE: chan.value will range between 0 and 65535 inclusive (16-bit), even if the underlying analog to digital converter (ADC) is lower resolution.

## Differential Mode

For differential mode, you provide two pins when setting up the ADC channel. The reading will be the difference between the two. Here, we use pin 0 and 1:

```auto
chan = AnalogIn(ads, ads1x15.Pin.A0, ads1x15.Pin.A1)
```

You can create more channels by doing this again with different pins. However, note that not all pin combinations are possible. See the datasheets for details.

Once the channel is created, getting the readings is the same as before:

```
print(chan.value, chan.voltage)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/066/983/medium800/sensors_dif_screen.jpg?1543875968)

Danger: NOTE: chan.value will range between 0 and 65535 inclusive (16-bit), even if the underlying analog to digital converter (ADC) is lower resolution.

## Gain

Both the ADS1015 and the ADS1115 have a Programmable Gain (PGA) that you can set to amplify the incoming signal before it reaches the ADC. The available settings and associated Full Scale (FS) voltage range are shown in Table 3 of the datasheet.

![](https://cdn-learn.adafruit.com/assets/assets/000/070/758/medium800/sensors_ads1015_pga_range.jpg?1549409927)

You set the gain to one of the values using the `gain` property, like this:

```
ads.gain = 16
```

Note that setting `gain` will affect the raw ADC `value` but not the `voltage` (expect for variance due to noise). For example:

```
&gt;&gt;&gt; ads.gain
1
&gt;&gt;&gt; chan.value, chan.voltage
(84, 0.168082)
&gt;&gt;&gt; ads.gain = 16
&gt;&gt;&gt; ads.gain
16
&gt;&gt;&gt; chan.value, chan.voltage
(1335, 0.167081)
&gt;&gt;&gt; 
```

The `value` changed from 84 to 1335, which is pretty close to 84 x 16 = 1344. However, the `voltage` returned in both cases is still the actual input voltage of ~0.168 V.

## Single Mode

Single mode (not to be confused with single-ended mode) always waits until the analog to digital conversion is completed by the ADC to read the value. This is slower, but it is really the only way to read from more than one pin on the ADC. This is the default mode, but if you ever need to manually set it, here's how:

```python
ads.mode = Mode.SINGLE
```

## Continuous Mode

In continuous mode, the board will read the latest value that the ADS1x15 device has converted. This is faster as it does not have to wait for the ADC to finish converting the value, but it only really works when reading data from one of the four pins on the ADC. You can set it to continuous mode using the line below:

```python
ads.mode = Mode.CONTINUOUS
```

## Challenges to Reading Quickly

The best approach to reading data from the ADC quickly would be to use interrupts which would enable the digital value to be recorded from the desired pin as soon as the ADC has converted it. However, CircuitPython does not support the use of interrupts, so this isn't possible. To partially solve this, the continuous mode was added, which will always return the most recently converted value with very low latency since it does not wait for the new value to be ready.

## More Info

The above examples cover the basic setup and usage using default settings. For more details, see the [documentation](https://circuitpython.readthedocs.io/projects/ads1x15/en/latest/).

# Adafruit 4-Channel ADC Breakouts

## Python Docs

# Adafruit 4-Channel ADC Breakouts

## Arduino Code

# Wiring

Hooking up the ADS1x15 to your Arduino is easy:

Info: 

- Connect&nbsp; **SCL** &nbsp;on the Metro to&nbsp; **SCL** &nbsp;**(yellow wire in STEMMA QT version)&nbsp;**on the ADS1x15
- Connect&nbsp; **SDA** &nbsp;on the Metro to&nbsp; **SDA** &nbsp;**(blue wire in STEMMA QT version)** on the ADS1x15
- Connect&nbsp; **GND** &nbsp;on the Metro to&nbsp;**GND (black wire in STEMMA QT version)**&nbsp;on the ADS1x15
- Connect **5V** &nbsp;on the Arduino/Metro to&nbsp; **VIN** &nbsp;**(red wire in STEMMA QT version)**&nbsp;on the ADS1x15

![arduino_compatibles_arduinoStemma_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/112/701/medium640/arduino_compatibles_arduinoStemma_bb.png?1656449215)

![arduino_compatibles_metroExpressBB_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/112/702/medium640/arduino_compatibles_metroExpressBB_bb.png?1656449228)

![arduino_compatibles_sensors_ADC_i2c_bb-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/112/703/medium640/arduino_compatibles_sensors_ADC_i2c_bb-1024.jpg?1656449266)

The Adafruit\_ADS1X15 library supports both single-ended and differential readings as well as comparator operations on both the ADS1015 and ADS1115 breakout boards. &nbsp;The library uses the Wire library for I2C communication, so `Wire.h` must be included.

## Construction and Initialization:

**Adafruit\_ADS1015();**  
Construct an instance of an ADS1015

**Adafruit\_ADS1115();&nbsp;&nbsp;**  
Construct an instance of an ADS1115   
  
**begin();**  
Initialize the ADC for operation using the default address and I2C bus.

**begin(0x49);**  
Initialize the ADC for operation using specified address of 0x49.

&nbsp;

**Example:**

Danger: 

```python
#include &lt;Wire.h&gt;
#include &lt;Adafruit_ADS1X15.h&gt;

Adafruit_ADS1015 ads1015;  	// Construct an ads1015 
Adafruit_ADS1115 ads1115;	// Construct an ads1115 

void setup(void)
{
  ads1015.begin();  // Initialize ads1015 at the default address 0x48
  ads1115.begin(0x49);  // Initialize ads1115 at address 0x49
}
```

## Single Ended Conversion:
**uint16\_t readADC\_SingleEnded(uint8\_t channel);&nbsp;&nbsp;**  
Perform a single-ended analog to digital conversion on the specified channel.  
  
**Example:** ```python
#include &lt;Wire.h&gt;
#include &lt;Adafruit_ADS1X15.h&gt;

Adafruit_ADS1015 ads1015;

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.begin();
}

void loop(void)
{
  int16_t adc0, adc1, adc2, adc3;

  adc0 = ads1015.readADC_SingleEnded(0);
  adc1 = ads1015.readADC_SingleEnded(1);
  adc2 = ads1015.readADC_SingleEnded(2);
  adc3 = ads1015.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);
}
```

## Differential Conversion:
**int16\_t readADC\_Differential\_0\_1(void);&nbsp;&nbsp;**  
Perform a differential analog to digital conversion on the voltage between&nbsp;channels 0 and 1.  
  
**int16\_t readADC\_Differential\_2\_3(void);&nbsp;&nbsp;**  
Perform a differential analog to digital conversion on the voltage between&nbsp;channels 2 and 3.  
  
**Example:** ```python
#include &lt;Wire.h&gt;
#include &lt;Adafruit_ADS1X15.h&gt;

Adafruit_ADS1015 ads1015;

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Hello!");
  
  Serial.println("Getting differential reading from AIN0 (P) and AIN1 (N)");
  Serial.println("ADC Range: +/- 6.144V (1 bit = 3mV)");
  ads1015.begin();
}

void loop(void)
{
  int16_t results;

  results = ads1015.readADC_Differential_0_1();
  Serial.print("Differential: "); Serial.print(results); Serial.print("("); Serial.print(results * 3); Serial.println("mV)");

  delay(1000);
}
```

## Comparator Operation:
Comparator mode allows you to compare an input voltage with a threshold level and generate an alert signal (on the ALRT pin)&nbsp;if the threshold is exceeded. &nbsp;This pin can be polled with a digital input pin, or it can be configured to generate an interrupt.  
  
**void startComparator\_SingleEnded(uint8\_t channel, int16\_t threshold);&nbsp;&nbsp;**  
Set the threshold and channel for comparator operation.  
  
**int16\_t getLastConversionResults();**  
Get the last conversion result and clear the comparator.  
  
**Example:** ```python
#include &lt;Wire.h&gt;
#include &lt;Adafruit_ADS1X15.h&gt;

Adafruit_ADS1015 ads1015;

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Hello!");
  
  Serial.println("Single-ended readings from AIN0 with &gt;3.0V comparator");
  Serial.println("ADC Range: +/- 6.144V (1 bit = 3mV)");
  Serial.println("Comparator Threshold: 1000 (3.000V)");
  ads1015.begin();
  
  // Setup 3V comparator on channel 0
  ads1015.startComparator_SingleEnded(0, 1000);
}

void loop(void)
{
  int16_t adc0;

  // Comparator will only de-assert after a read
  adc0 = ads1015.getLastConversionResults();
  Serial.print("AIN0: "); Serial.println(adc0);
  
  delay(100);
}
```

## Adjusting Gain
To boost small signals, the gain can be adjusted on the ADS1x15 chips in the following steps:  

- **GAIN\_TWOTHIRDS** (for an input range of +/- 6.144V)
- **GAIN\_ONE** (for an input range of +/-4.096V)
- **GAIN\_TWO** (for an input range of +/-2.048V)
- **GAIN\_FOUR** (for an input range of +/-1.024V)
- **GAIN\_EIGHT** (for an input range of +/-0.512V)
- **GAIN\_SIXTEEN** (for an input range of +/-0.256V)

**adsGain\_t getGain(void)**  
  
Reads the current gain value (default = 2/3x)  
```
adsGain_t gain = getGain();
```

**void setGain(adsGain\_t gain)**  
  
Sets the gain for the ADS1x15  
```
ads1015.setGain(GAIN_TWOTHIRDS);  // 2/3x gain +/- 6.144V  1 bit = 3mV (default)

// ads1015.setGain(GAIN_ONE);     // 1x gain   +/- 4.096V  1 bit = 2mV
// ads1015.setGain(GAIN_TWO);     // 2x gain   +/- 2.048V  1 bit = 1mV
// ads1015.setGain(GAIN_FOUR);    // 4x gain   +/- 1.024V  1 bit = 0.5mV
// ads1015.setGain(GAIN_EIGHT);   // 8x gain   +/- 0.512V  1 bit = 0.25mV
// ads1015.setGain(GAIN_SIXTEEN); // 16x gain  +/- 0.256V  1 bit = 0.125mV
```

## Example
If we had an analog sensor with an output voltage ~1V (a TMP36, for example), we could set the gain on the ADC to **GAIN\_FOUR** , which would give us a +/-1.024V range. This would push the 1V input signal over the entire 12-bit or 16-bit range of the ADC, compared to the very limited range 1V would cover without adjusting the gain settings  
```
// Set the gain to 4x, for an input range of +/- 1.024V
// 1-bit = 0.5V on the ADS1015 with this gain setting
ads1015.setGain(GAIN_FOUR);

```

# Adafruit 4-Channel ADC Breakouts

## Arduino Docs

# Adafruit 4-Channel ADC Breakouts

## Downloads

## Software

- [ADS1x15 Library for Arduino](https://github.com/adafruit/Adafruit_ADS1X15 "Link: https://github.com/adafruit/Adafruit\_ADS1X15")

## Files

- [EagleCAD PCB Files on GitHub](https://github.com/adafruit/ADS1X15-Breakout-Board-PCBs)
- [ADS1015 Fritzing object (original version) in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20ADS1015%2012Bit%20I2C%20ADC.fzpz)
- [ADS1115 Fritzing object (original version) in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20ADS1115%2016Bit%20I2C%20ADC.fzpz)
- [ADS1015 Fritzing object (STEMMA QT version) in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20ADS1015%2012-Bit%20ADC%20STEMMA.fzpz)
- [ADS1115 Fritzing object (STEMMA QT version) in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20ADS1115%2016-Bit%20ADC%20STEMMA.fzpz)
- [ADS1015 Datasheet](http://adafruit.com/datasheets/ads1015.pdf "Link: http://adafruit.com/datasheets/ads1015.pdf")
- [ADS1115 Datasheet](http://adafruit.com/datasheets/ads1115.pdf "Link: http://adafruit.com/datasheets/ads1115.pdf")
- [ADS1115 3D models on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/1085%20ADS1115%20ADC)

## Schematic and Fab Print STEMMA QT Version (Identical For Both)
![](https://cdn-learn.adafruit.com/assets/assets/000/112/763/medium800/arduino_compatibles_schem.png?1656508168)

![](https://cdn-learn.adafruit.com/assets/assets/000/112/764/medium800/arduino_compatibles_fab.png?1656508177)

## Schematic and Fab Print Original Version (Identical For Both)
![](https://cdn-learn.adafruit.com/assets/assets/000/036/145/medium800/sensors_schem.png?1475541078)

![](https://cdn-learn.adafruit.com/assets/assets/000/036/146/medium800/sensors_fabprint.png?1475541096)

![](https://cdn-learn.adafruit.com/assets/assets/000/140/387/medium800/arduino_compatibles_1085_ADS1115_ADC.jpg?1760372557 )


## Featured Products

### ADS1115 16-Bit ADC - 4 Channel with Programmable Gain Amplifier

[ADS1115 16-Bit ADC - 4 Channel with Programmable Gain Amplifier](https://www.adafruit.com/product/1085)
For microcontrollers without an analog-to-digital converter or when you want a higher-precision ADC, the ADS1115 provides 16-bit precision at 860 samples/second over I2C. The chip can be configured as 4 single-ended input channels, or two differential channels. As a nice bonus, it even...

In Stock
[Buy Now](https://www.adafruit.com/product/1085)
[Related Guides to the Product](https://learn.adafruit.com/products/1085/guides)
### ADS1015 12-Bit ADC - 4 Channel with Programmable Gain Amplifier

[ADS1015 12-Bit ADC - 4 Channel with Programmable Gain Amplifier](https://www.adafruit.com/product/1083)
For microcontrollers without an analog-to-digital converter or when you want a higher-precision ADC, the ADS1015 provides 12-bit precision at 3300 samples/second over I2C. The chip can be configured as 4 single-ended input channels&nbsp;or two differential channels. As a nice bonus, it even...

In Stock
[Buy Now](https://www.adafruit.com/product/1083)
[Related Guides to the Product](https://learn.adafruit.com/products/1083/guides)
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
### Adafruit Assembled Pi Cobbler Breakout + Cable for Raspberry Pi

[Adafruit Assembled Pi Cobbler Breakout + Cable for Raspberry Pi](https://www.adafruit.com/product/914)
Now that you've finally got your hands on a [Raspberry Pi® Model B](http://www.raspberrypi.org/), you're probably itching to make some fun embedded computer projects with it. What you need is an add on prototyping Pi Cobbler from Adafruit, which can break out all those...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/914)
[Related Guides to the Product](https://learn.adafruit.com/products/914/guides)
### Adafruit METRO 328 Fully Assembled - Arduino IDE compatible

[Adafruit METRO 328 Fully Assembled - Arduino IDE compatible](https://www.adafruit.com/product/50)
We sure love the ATmega328 here at Adafruit, and we use them&nbsp;_a lot_&nbsp;for our own projects. The processor has plenty of GPIO, Analog inputs, hardware UART SPI and I2C, timers and PWM galore - just enough for most simple projects. When we need to go small, we use a <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/50)
[Related Guides to the Product](https://learn.adafruit.com/products/50/guides)
### Full Sized Premium Breadboard - 830 Tie Points

[Full Sized Premium Breadboard - 830 Tie Points](https://www.adafruit.com/product/239)
This is a 'full-size' premium quality breadboard, 830 tie points. Good for small and medium projects. It's 2.2" x 7" (5.5 cm x 17 cm) with a standard double-strip in the middle and two power rails on both sides. You can pull the power rails off easily to make the...

In Stock
[Buy Now](https://www.adafruit.com/product/239)
[Related Guides to the Product](https://learn.adafruit.com/products/239/guides)

## Related Guides

- [Circuit Playground: D is for Diode](https://learn.adafruit.com/circuit-playground-d-is-for-diode.md)
- [Arduino "Hunt The Wumpus"](https://learn.adafruit.com/arduino-hunt-the-wumpus.md)
- [DIY 8x2 LCD Shield](https://learn.adafruit.com/diy-8x2-lcd-shield.md)
- [WiFi Controlled Mobile Robot](https://learn.adafruit.com/wifi-controlled-mobile-robot.md)
- [Wave Shield Talking Clock](https://learn.adafruit.com/wave-shield-talking-clock.md)
- [Electronic Demon Costume](https://learn.adafruit.com/electronic-demon-costume.md)
- [Multi-tasking the Arduino - Part 1](https://learn.adafruit.com/multi-tasking-the-arduino-part-1.md)
- [Skill Badge Requirements: Microcontrollers](https://learn.adafruit.com/skill-badge-requirements-microcontrollers.md)
- [Adafruit  PCA9685 16-Channel Servo Driver](https://learn.adafruit.com/16-channel-pwm-servo-driver.md)
- [Ladyada's Learn Arduino - Lesson #2](https://learn.adafruit.com/ladyadas-learn-arduino-lesson-number-2.md)
- [Circuit Playground Sound-Controlled Robot](https://learn.adafruit.com/circuit-playground-sound-controlled-robot.md)
- [Arduino Lesson 11. LCD Displays - Part 1](https://learn.adafruit.com/adafruit-arduino-lesson-11-lcd-displays-1.md)
- [Current Limiting Stepper Driver with DRV8871](https://learn.adafruit.com/current-limiting-stepper-driver-with-drv8871.md)
- [Adafruit INA219 Current Sensor Breakout](https://learn.adafruit.com/adafruit-ina219-current-sensor-breakout.md)
- [2.8" TFT Touch Shield](https://learn.adafruit.com/2-8-tft-touch-shield.md)
