ADS1115 — four analogue inputs¶
Supported
A driver ships with inoCORE. This part can be used today.
What it does¶
Turns a voltage into a number, sixteen bits at a time, over I²C. It is the part to reach for when the board itself has no analogue input worth using, or when the signal is small enough that the built-in converter would drown it in noise — the ADS1115 has a programmable amplifier in front of it, so a millivolt-level signal still fills the range.
Four inputs measured against ground, or two measured against each other.
Parameters¶
| Measures | Voltage |
| Resolution | 16 bits, signed |
| Inputs | 4 single-ended, or 2 differential |
| Full scale | 6.144, 4.096, 2.048, 1.024, 0.512 or 0.256 V |
| Interface | I²C |
The full scale is set per chip with the range key. Without it, 4.096 V is
used. In a single-ended arrangement the raw value runs 0…32767.
Bus and addressing¶
I²C, addresses 0x48–0x4B, chosen by how the ADDR pin is tied. Four of them can share one bus.
Wiring¶
Power, ground, SDA and SCL. Pull-up resistors on the two bus lines — most breakout boards already have them, and several boards on one bus means several sets of pull-ups in parallel, which is a real limit on how many you can hang on one wire.
In a project¶
peripherals:
- { type: ADS1115, name: adc1, bus: i2c, addr: 0x48, range: 4.096 }
tags:
- name: temperature
datatype: f32
source: { periph: { chip: adc1, pin: 0 } } # pin = channel AIN0..3
gain: 0.0125 # raw value -> physical units
offset: -40.0
deadband: 0.5 # mandatory on analogue tags — filters noise
unit: "°C"
Channels are measured in turn. Each one is refreshed within four control cycles at the latest — 40 ms at a 10 ms cycle.
If the chip is unplugged or was never fitted, one event goes into the diagnostics, the tags hold their last value and the panel keeps running. It comes back to life by itself once connected.
Traps¶
| Trap | What to do |
|---|---|
| No deadband on the tag | A noisy analogue input redraws the screen forever and floods every client listening to it. The deadband is not optional. |
| Full scale set too wide | The reading is quantised more coarsely than it needs to be. Pick the smallest range the signal fits into. |
| Two chips on the same address | They will fight. The ADDR pin has four positions; use them. |