Source: https://mokxi.com/libraries/ads1x15-tillaart
Updated: 2026-11-02

Libraries / Sensors
Arduino library · Sensors

# ADS1X15 (Rob Tillaart): ADS1115 reads without blocking

Rob Tillaart’s ADS1X15 is the other popular driver for the ADS1115 and its family, with one class per chip: ADS1013, ADS1014, ADS1015, ADS1113, ADS1114 and ADS1115. You give the I2C address in the constructor, start Wire yourself, and read an input with readADC(channel).

Open the example in the editor See the calls

Built in on Mokxi: #include <ADS1X15.h> and it builds, with nothing to install. Free, and no account needed.

## What ADS1X15 does

Its gain numbers are the amplifier’s own settings rather than names: 0 for plus or minus 6.144 V, 1 for 4.096 V, 2 for 2.048 V, 4, 8 and 16 for the smaller ranges. toVoltage(1) tells you how many volts one count is at the current gain, so a reading times that factor is the input voltage.

Where the library shines is non-blocking reads. requestADC() starts a conversion and returns at once; isReady() says when it is done; getValue() collects it. A sketch can keep a display or a motor going while the converter works. In Mokxi the ADS1013, ADS1014 and ADS1015 classes read the ADS1115 part as 12 bits.

Library Manager name | ADS1X15

Author | Rob Tillaart

Include | #include <ADS1X15.h>

Boards | every board Mokxi compiles for but ATtiny85

In the simulator | Simulated: it runs against the part the way it does on the bench.

Parts it drives | Sixteen-bit ADC, ADS1115

## Install it

It builds on every board Mokxi compiles for but ATtiny85.

In Mokxi it is built in: #include <ADS1X15.h> and the sketch compiles, with no download, no zip and no Library Manager.

On a real board, install "ADS1X15" by Rob Tillaart from the Arduino IDE’s Library Manager (Sketch, Include Library, Manage Libraries), or add ADS1X15 to lib_deps in PlatformIO. Mokxi follows the calls of release 0.6.2, so a sketch written here builds there too.

What to know in the simulator: The ADS1013, ADS1014 and ADS1015 classes read the ADS1115 part as twelve bits.

ESP32-C3 · Arduino Uno · Arduino Nano · Arduino Mega 2560 · Arduino Leonardo · SparkFun Pro Micro · Arduino Micro · ESP32-C6 · Raspberry Pi Pico · Raspberry Pi Pico W · Seeed XIAO SAMD21 · STM32 · STM32 Nucleo-F411RE · STM32 Blue Pill · micro:bit V2 · Arduino Uno R4 · ESP32 DevKit · ESP32-S3-DevKitC-1 · ESP8266 NodeMCU · Arduino Pro Mini 3.3 V · Seeed XIAO ESP32-C3 · ESP32-C3 SuperMini · Seeed XIAO ESP32-C6 · ESP32-DevKitC V4 · LOLIN32 Lite · Wemos D1 R32 · Cheap Yellow Display · TTGO T-Display · Seeed XIAO ESP32-S3 · Arduino Nano ESP32 · Arduino Nano RP2040 Connect · Seeed XIAO RP2040 · Waveshare RP2040-Zero · Arduino Uno R4 WiFi

## The calls you will use

In the order a sketch meets them.

### ADS1115 ADS(0x48)

Creates the converter at address 0x48.

### ADS.begin()

Checks the chip answers. Call Wire.begin() before it.

### ADS.isConnected()

True when the address answers, for a clear message in setup().

### ADS.setGain(0)

Sets the range: 0 is plus or minus 6.144 V, 1 is 4.096 V, 2 is 2.048 V, and 4, 8 and 16 are smaller.

### int16_t raw = ADS.readADC(0)

Converts input 0 and waits for the result.

### ADS.toVoltage(1)

The voltage of one count at the current gain.

### ADS.requestADC(0)

Starts a conversion on input 0 and returns at once. Poll isReady(), then read the result with getValue().

### ADS.readADC_Differential_0_1()

The difference between inputs 0 and 1, with the other pairs beside it.

### ADS.setDataRate(7)

Samples per second from 0 (8 a second) to 7 (860 a second). 4 is the default of 128.

## Example: Read 3.3 V on an ADS1115 the Rob Tillaart way

On the Arduino Uno R3. It runs in the browser exactly as printed.

sketch.ino · Arduino Uno R3

### Wiring

- Arduino Uno R3 A4 to Sixteen-bit ADC, ADS1115 SDA
- Arduino Uno R3 A5 to Sixteen-bit ADC, ADS1115 SCL
- Arduino Uno R3 5V to Sixteen-bit ADC, ADS1115 VDD
- Arduino Uno R3 GND to Sixteen-bit ADC, ADS1115 GND
- Arduino Uno R3 3V3 to Sixteen-bit ADC, ADS1115 A0
- Arduino Uno R3 GND to Sixteen-bit ADC, ADS1115 A1

Open it in the editor, wired and ready to run

## Common errors and how to fix them

### readADC() returns 0 or -1 on every channel

Check isConnected() first. If it is false, the address or wiring is wrong; if true, make sure Wire.begin() came before ADS.begin().

### getValue() returns the same number twice

It was called before the conversion finished. After requestADC(), wait until isReady() is true before calling getValue().

### A sketch from the Adafruit library will not compile

The two libraries have different class names and calls. Replace Adafruit_ADS1115 with ADS1115 ADS(0x48), readADC_SingleEnded() with readADC(), and computeVolts() with a reading times toVoltage(1).

## Keep going

### Learn

- Analog vs Digital Pins, and ADC Resolution

### Parts

- Sixteen-bit ADC, ADS1115

### More sensors libraries

- DHT sensor library
- DHT20
- VL53L0X
- Adafruit_VL53L0X
- HX711 Arduino Library
- MPU6050
- Adafruit MPU6050
- BME280

Every built-in library · Open the editor

## Try ADS1X15 without installing anything

Open the example, change the sketch, and keep your version in a free account.

Start building free

Open the editor
