ADS1115 ADC (I²C)
The ADS1115 is a 16-bit, 4-channel analog-to-digital converter that talks over I²C. It costs $6 — twice the MCP3008 — and buys precision: 32768 steps instead of 1024, a programmable gain amplifier that zooms into small signals, and a two-wire connection. It is the ADC to reach for when a potentiometer reading must be precise rather than merely cheap. Like every ADC on a Pi it exists because the GPIO header is digital only; the analog inputs primer has the why.
Pins
| Pin | What it is | Type |
|---|---|---|
| VDD | Supply 2.0–5.5 V | power |
| GND | Ground | ground |
| SCL | I²C clock | io |
| SDA | I²C data | io |
| ADDR | Address select: GND 0x48, VDD 0x49, SDA 0x4A, SCL 0x4B | io |
| ALRT | Alert / ready output (open drain) | io |
| A0 | Analog input 0 | io |
| A1 | Analog input 1 | io |
| A2 | Analog input 2 | io |
| A3 | Analog input 3 | io |
A0–A3 are the analog inputs, each measured against ground (or against another input in differential mode). ADDR picks the I²C address: to GND it answers at 0x48, to VDD 0x49, to SDA 0x4A, to SCL 0x4B, so four chips can share one bus. ALRT is an open-drain alert output and can be left unwired. VDD takes 2.0–5.5 V, and SDA/SCL go to the Pi's I²C pins — GPIO2 and GPIO3.
Wiring it in circuit.py
A potentiometer on channel A0, with ADDR strapped to ground for address 0x48:
from wiring import *
pi = Pi()
pot = Potentiometer(10000)
adc = ADS1115()
pi.V3_3 >> pot.pin3
pot.pin1 >> pi.GND
pot.wiper >> adc.a0
pi.V3_3 >> adc.vdd
adc.gnd >> pi.GND
pi.SDA >> adc.sda
pi.SCL >> adc.scl
adc.addr >> pi.GND # 0x48; VDD gives 0x49, SDA 0x4A, SCL 0x4BDriving it in main.py
The runtime ships Adafruit's CircuitPython driver, adafruit_ads1x15, and a Blinka-compatible board module, so the same code runs on a real Pi after pip install adafruit-circuitpython-ads1x15:
import board
from adafruit_ads1x15 import ADS1115, AnalogIn, ads1x15
from time import sleep
ads = ADS1115(board.I2C())
knob = AnalogIn(ads, ads1x15.Pin.A0)
while True:
print(f"{knob.voltage:.3f} V raw {knob.value}")
sleep(0.5)AnalogIn works much like the MCP3008's properties: .voltage, .value (16-bit) and .convert_to_voltage(). Small signals can be zoomed with ADS1115(board.I2C(), gain=16), which makes the full scale ±0.256 V. The smbus2 library can also drive the registers directly if you prefer raw bytes.
Electrical notes
- Supply 2.0–5.5 V, 150 µA. The internal reference means there is no VREF pin: the range comes from the gain, one of ±6.144, ±4.096, ±2.048, ±1.024, ±0.512 or ±0.256 V (gains 2/3, 1, 2, 4, 8, 16; gain 1 is the default).
- 16 bits over the chosen range. At gain 1 one LSB is 125 µV, but noise is about one LSB too: the datasheet quotes 187.5 µV rms at ±6.144 V down to 7.81 µV rms at ±0.256 V at the slowest 8 SPS rate. The model adds a per-chip offset of up to 50 µV; datafeed knobs scale the noise and offset.
- Data rates are 8, 16, 32, 64, 128, 250, 475 and 860 SPS. A single-shot conversion takes 1/data-rate of simulated time; reading the conversion register while it runs returns the previous result.
- Whatever the gain says, the inputs must stay between GND − 0.3 V and VDD + 0.3 V: the PGA only scales what the chip can already survive. A 5 V sensor output on a 3V3-powered breakout is out of range.
- Registers are 16-bit and big-endian; the pointer byte selects the conversion (0), config (1) or a comparator threshold register. The config register resets to 0x8583.
Simulator vs real hardware
- The register map is implemented at byte level, so the Adafruit driver and raw smbus2 code both work; the SPI pins are irrelevant to this part.
- Single-shot mode sets the OS bit in the config register, clears it while converting and sets it when the result is ready; continuous mode re-latches the newest conversion on every read.
- The comparator threshold registers can be written and read, but the
ALRToutput is not driven — nothing buzzes on a threshold crossing as it would with a real comparator wired in. - I²C addresses follow the
ADDRwiring exactly, and a floatingADDRanswers at 0x48 like a grounded one. - Readings include quantisation to 16 bits plus the noise and offset model above, so the lowest bit or two wander the way they do on a bench.
Going deeper
- Primer: analog inputs and ADCs; the cheaper route is the MCP3008.
- The same sensor read through I²C: potentiometer, light sensor.
- Library: smbus2 for direct register access.
- Pre-wired module: the knob + ADC kit pairs a pot with the MCP3008.
Further reading
- ADS111x datasheet (TI SBAS444) — the register map, PGA ranges and noise table.
- Adafruit CircuitPython ADS1x15 docs —
ADS1115,AnalogInandgain. - Adafruit: 4-channel ADC breakouts — the breakout, address jumpers and wiring.