Sixteen-bit ADC, ADS1115
Four sixteen-bit analog inputs, single or in pairs. The gain sets the full scale, not the supply.
- 10 pins
- In 1 project
The Sixteen-bit ADC, ADS1115 in brief
What it is, and where it sits on the bench.
The ADS1115 is a sixteen-bit analog-to-digital converter with four inputs, sold on a blue I2C breakout. Boards reach for it when the built-in ten-bit analogRead() is too coarse, when they need the difference between two voltages instead of each against ground, or when they have no analog pins left. Its programmable gain sets the full-scale range, from plus or minus 6.144 V down to 0.256 V, so a small signal can use more of the counts; it never lets an input go past the supply. In Mokxi the four registers, the eight input pairings, the six gains and the eight data rates all behave as the datasheet lays out. A conversion takes real time, one period of the data rate, and reading too soon hands back the previous result, exactly the mistake that catches people on the bench. The ALRT comparator works too, in its traditional and window modes.
- Family
- Sensors
- Pins
- 10
10 pins
Named as the editor names them, so a wire lands where you expect it.
GND (or left alone) is 0x48, to VDD is 0x49.How to use the ADS1115 ADC with an Arduino or ESP32
The built-in power meter runs on an ESP32-C3, whose I2C pins are GPIO 8 for SDA and GPIO 9 for SCL. The ADS1115’s VDD goes to 3.3 V and GND to ground, and ADDR is left unwired, which puts it at 0x48. Its A0 input sits on the node between an INA219 current monitor and a 220 ohm load, so the two chips measure the same voltage and you can compare them line by line.
With Adafruit’s ADS1X15 library, set the gain before begin(): GAIN_ONE is a full scale of 4.096 V, which makes one count 125 µV. readADC_SingleEnded(0) starts a conversion on A0, waits for it, and returns the counts; computeVolts() turns them into volts at whatever gain is in use. Change the resistor in the properties panel while it runs and both chips’ figures move together, the INA219 in 4 mV steps and the ADS1115 in much finer ones.
On an Uno, SDA and SCL are A4 and A5 and the module runs from 5 V; keep each input between GND and VDD whatever gain you pick.
#include <Adafruit_ADS1X15.h>
Adafruit_ADS1115 ads;
void setup() {
Serial.begin(115200);
ads.setGain(GAIN_ONE); // +/-4.096 V, 125 uV a count
if (!ads.begin()) Serial.println("no ADS1115 at 0x48");
}
void loop() {
int16_t counts = ads.readADC_SingleEnded(0);
Serial.println(ads.computeVolts(counts), 4);
delay(500);
}Common Sixteen-bit ADC, ADS1115 errors and fixes
Questions and answers
How many ADS1115 boards can share one I2C bus?
The chip has four addresses, 0x48 to 0x4B, set by where ADDR is tied. The simulator models the first two, ADDR to GND for 0x48 and to VDD for 0x49.
Is the ADS1115 better than the Arduino’s own analogRead()?
For resolution, yes: sixteen bits against ten, and a gain you choose. It is also slower, up to 860 samples a second, and it costs an I2C transaction per reading, so it suits slow, precise signals more than fast ones.
Can the ADS1115 measure negative voltages?
Only as a difference between two inputs, such as A0 minus A1. No input may go below GND or above VDD.
Does the simulated ADS1115 have noise?
No. A steady input gives the same count every time, where a real board wanders by a few counts, more at the highest gains.
What is true about the Sixteen-bit ADC, ADS1115, here
In its help article’s own words: what the simulation gets right, and where it stops.
Modeled
The four registers (conversion, config, and the two thresholds) and their reset values, the multiplexer's eight settings, the six gains and the eight data rates.
A conversion takes time: one over the data rate, 7.8 ms at the default 128
samples a second and 125 ms at 8. In single-shot mode the OS bit reads 0 until it is
done, and reading the conversion register before then gets the previous result,
which is the commonest ADS1115 bug. Continuous mode refreshes the result every period.
The comparator on ALRT: traditional or window, active low or high, latching or
not, and asserting after one, two or four readings past a threshold. Set the high
threshold's top bit and clear the low one's and ALRT becomes the conversion-ready
signal instead.
Not modeled
Noise: a steady input gives the same count every time. The input impedance and the
anti-aliasing filter. ADDR tied to SDA or SCL for 0x4A and 0x4B: only
0x48 and 0x49 are modeled.
From ADS1115 sixteen-bit ADC, in full.
See the Sixteen-bit ADC, ADS1115 in a project
One built-in project uses it. It opens in the editor, already wired.
The boards it is shown on
This board has a built-in project with the Sixteen-bit ADC, ADS1115 in it.
Arduino libraries for the Sixteen-bit ADC, ADS1115
Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.
The rest of the bench
Every one of these is drawn and simulated the same way.
Wire up the Sixteen-bit ADC, ADS1115
Open the editor and push it into the breadboard. It is free, and it runs on your own machine.