ADS1115 with ESPHome: Gain, Differential Inputs and Calibration

Use ADS1115 with ESPHome correctly: gain ranges, single-ended vs differential inputs, safe voltages, sample rate, CT clamps, voltage dividers and two-point calibration examples.

The ADS1115 is one of the easiest ways to add higher-resolution analogue inputs to an ESP32, but the most common mistakes are choosing the wrong gain, misunderstanding differential inputs and assuming the selected ±6.144 V range means a 3.3 V-powered ADC can safely accept 6 V.

In ESPHome, the ADS1115 can measure four single-ended inputs or several differential input pairs, with programmable full-scale ranges from ±6.144 V down to ±0.256 V. Choosing a smaller range improves voltage resolution, but it does not change the absolute voltage that is safe on the ADS1115 pins.

For most ESP32 projects, the practical workflow is: power the ADS1115 from 3.3 V, choose the smallest gain range that still covers the expected signal, keep every analogue pin inside the ADS1115 supply rails, then use ESPHome filters to convert the measured voltage into the real engineering value.

ADS1115 at a Glance

FeatureADS1115
Resolution16 bit
Maximum sample rate860 samples/s
Analogue inputs4 multiplexed inputs
Single-ended channels4
Differential inputsUp to 2 independent pairs, or selectable mixed pairs
PGA ranges±6.144, ±4.096, ±2.048, ±1.024, ±0.512, ±0.256 V
Supply range2.0–5.5 V
InterfaceI²C
I²C addresses0x48, 0x49, 0x4A, 0x4B
ESPHome supportNative ADS1115 component

TI describes the ADS1115 as a 16-bit delta-sigma ADC with an internal reference, oscillator, programmable gain amplifier and input multiplexer. It is designed for relatively slow precision measurements rather than high-speed waveform capture.

For basic ESP32 wiring and Arduino examples, see our existing ADS1115 with ESP32 wiring and gain guide. This article concentrates on ESPHome configuration, differential measurements and calibration.

Basic ESPHome Setup

First configure I²C and create the ADS1115 hub:

i2c:
  sda: GPIO21
  scl: GPIO22
  scan: true

ads1115:
  - address: 0x48
    id: ads_hub

Then add individual analogue channels:

sensor:
  - platform: ads1115
    ads1115_id: ads_hub
    multiplexer: A0_GND
    gain: 4.096
    name: "ADS1115 A0 Voltage"
    update_interval: 5s

The default ADS1115 address is 0x48. ESPHome also supports 0x49, 0x4A and 0x4B depending on how the ADS1115 ADDR pin is connected.

ADS1115 I²C Addresses

ADDR connectionI²C address
GND0x48
VDD0x49
SDA0x4A
SCL0x4B

This lets you use up to four ADS1115 devices on one I²C bus without a multiplexer, potentially providing 16 single-ended analogue channels.

Gain Does Not Mean Amplification in the Way You Might Expect

ESPHome calls the setting gain, but the value you enter is the ADS1115 full-scale voltage range. A lower number means more gain and finer resolution.

ESPHome gainADC full-scale rangeApprox. ADS1115 LSB
6.144±6.144 V187.5 µV
4.096±4.096 V125 µV
2.048±2.048 V62.5 µV
1.024±1.024 V31.25 µV
0.512±0.512 V15.625 µV
0.256±0.256 V7.8125 µV

The best gain is normally the smallest full-scale range that safely contains your expected signal. A sensor producing 0–1 V should not use ±6.144 V unless you specifically need the extra headroom, because much of the ADC’s available resolution is then unused.

The Most Important Safety Rule: Gain Does Not Raise the Pin Voltage Limit

If the ADS1115 is powered from 3.3 V, selecting gain: 6.144 does not mean you can apply 6.144 V to AIN0.

TI specifies that the analogue inputs must remain within the device’s absolute input limits. ESPHome highlights the same point: no analogue input should exceed approximately VDD + 0.3 V. With a 3.3 V supply, that means roughly 3.6 V maximum at any AIN pin.

The PGA range tells the converter how it scales the differential signal. It does not provide overvoltage protection.

If you need to measure a 5 V, 12 V or 24 V signal, use a correctly designed voltage divider, isolation amplifier or other signal-conditioning circuit before the ADS1115.

Single-Ended Input Modes

For ordinary sensors referenced to ground, use one of the four single-ended multiplexer settings:

A0_GND
A1_GND
A2_GND
A3_GND

For example:

sensor:
  - platform: ads1115
    multiplexer: A0_GND
    gain: 4.096
    name: "Pressure Sensor Voltage"
    update_interval: 1s

Single-ended mode is the natural choice for devices such as potentiometers, 0–3.3 V sensors, battery dividers and analogue output modules whose ground is shared with the ADS1115.

Differential Input Modes

Differential measurement reports the voltage difference between two analogue pins rather than measuring one pin against ground.

ESPHome currently supports these differential selections:

A0_A1
A0_A3
A1_A3
A2_A3

If A0 is 1.200 V and A1 is 1.150 V, then:

A0 - A1 = +0.050 V

If the two inputs are reversed:

A1 - A0 = -0.050 V

This is useful for bridge sensors, shunt measurements, current transformers with suitable conditioning and other cases where the signal of interest is the difference between two nearby voltages.

Differential Does Not Mean Isolated

This is one of the most dangerous misunderstandings around ADS1115.

Differential mode lets the ADC subtract one input from another. It does not electrically isolate either input from the ADS1115 supply and ground.

Both AIN pins still need to remain inside the permitted analogue input range. You cannot connect A0 to +12 V and A1 to +11.9 V and assume the ADC only sees the 100 mV difference. Both absolute voltages would be far outside the limits of a 3.3 V-powered ADS1115.

Likewise, differential mode does not make it safe to connect an input several volts below ADS1115 ground.

Differential Measurement Example

For a low-voltage sensor producing a differential signal of less than 250 mV, while both pins remain safely inside the supply rails:

sensor:
  - platform: ads1115
    ads1115_id: ads_hub
    multiplexer: A0_A1
    gain: 0.256
    name: "Differential Signal"
    unit_of_measurement: "V"
    accuracy_decimals: 5
    sample_rate: 128
    update_interval: 1s

The ±0.256 V range gives the finest nominal voltage step. Only use it if the expected differential signal really stays within that range.

Choosing the Right Gain

Expected signalPractical starting gainNotes
0–3.3 V4.096Good use of range on 3.3 V systems
0–2.0 V2.048Use only if signal remains below full scale
0–1.0 V1.024Higher resolution
0–500 mV0.512Useful for low-level sensors
0–250 mV0.256Highest PGA gain
Unknown 0–3.3 V sensor4.096 or 6.144Start with headroom, then reduce range

For a 3.3 V-powered ADC, 4.096 is often a better match for a normal 0–3.3 V sensor than 6.144. The larger ±6.144 V range wastes some resolution because the ADS1115 input itself still cannot safely reach 6.144 V when VDD is only 3.3 V.

Sample Rate: Higher Is Not Always Better

ESPHome supports ADS1115 sample rates of:

8
16
32
64
128
250
475
860 SPS

The default is 860 SPS. ESPHome notes that lowering the sample rate can reduce noise, although very low rates also increase the time required for a conversion.

For a slowly changing temperature, pressure or battery voltage, 32–128 SPS is often more than enough. For a CT clamp waveform source, faster continuous sampling is more appropriate.

Do not confuse sample_rate with update_interval. The first controls how the ADS1115 performs the conversion internally; the second controls how often ESPHome publishes or checks the sensor.

Single-Shot vs Continuous Mode

By default, ESPHome leaves the ADS1115 in single-shot mode: the component requests a measurement when an update is required.

ESPHome also provides:

ads1115:
  - address: 0x48
    continuous_mode: true

Current ESPHome documentation specifically says to enable continuous mode for the ct_clamp sensor component. A CT clamp needs many samples from the AC waveform during its sampling window, not one isolated voltage conversion every few seconds.

ADS1115 with an ESPHome CT Clamp

For an AC current transformer, use the ADS1115 as the voltage-sampling source and pass it to the ESPHome ct_clamp component:

ads1115:
  - address: 0x48
    id: ads_hub
    continuous_mode: true

sensor:
  - platform: ads1115
    ads1115_id: ads_hub
    multiplexer: A0_GND
    gain: 2.048
    sample_rate: 860
    id: ct_voltage
    internal: true
    update_interval: 1s

  - platform: ct_clamp
    sensor: ct_voltage
    name: "House Current"
    update_interval: 10s
    sample_duration: 500ms
    unit_of_measurement: "A"
    device_class: current
    state_class: measurement

The correct gain depends on the CT conditioning circuit. The burden resistor and bias network must keep the waveform safely inside the ADS1115 input limits.

Our ESP32 CT Clamp Energy Monitor guide covers CT sizing, biasing and Home Assistant integration in more detail.

Measuring a Battery with a Voltage Divider

The ADS1115 cannot directly measure a 12 V battery. Use a resistor divider to reduce the battery voltage to a safe ADC voltage.

For a divider with Rtop from battery to AIN0 and Rbottom from AIN0 to ground:

Vadc = Vbattery × Rbottom / (Rtop + Rbottom)

Vbattery = Vadc × (Rtop + Rbottom) / Rbottom

Example: 100 kΩ on top and 27 kΩ on the bottom:

Divider ratio = 27 / 127
              ≈ 0.2126

Battery multiplier = 127 / 27
                   ≈ 4.7037

An ESPHome sensor can apply that scaling directly:

sensor:
  - platform: ads1115
    multiplexer: A0_GND
    gain: 4.096
    name: "Battery Voltage"
    unit_of_measurement: "V"
    accuracy_decimals: 2
    update_interval: 10s

    filters:
      - multiply: 4.7037

Always design the divider for the highest possible battery voltage, including charging voltage, not only the nominal battery label.

High-Value Dividers and ADS1115 Input Impedance

Very large divider resistors reduce battery drain, but they also increase source impedance. TI notes that the ADS1115 input impedance depends on the PGA setting and can affect accuracy when the signal source has a high output impedance.

This means a 1 MΩ / 270 kΩ divider is not automatically equivalent to 100 kΩ / 27 kΩ even though the ratio is identical. The ADC itself loads the divider slightly, and noise pickup becomes more significant.

For precision battery measurements, calculate the divider loading, consider a small filter capacitor and verify the result against a calibrated multimeter.

Two-Point Calibration with calibrate_linear

Real projects include resistor tolerance, sensor offset and board-level error. ESPHome’s calibrate_linear filter lets you correct the complete measurement chain against known reference values.

Suppose your calibrated multimeter says:

True voltage   ESPHome raw/scaled value
5.000 V        4.930 V
12.000 V       11.820 V

Add:

filters:
  - calibrate_linear:
      - 4.930 -> 5.000
      - 11.820 -> 12.000

ESPHome calculates the linear correction between those two points. This corrects both gain and offset together much better than simply adding a constant offset at one voltage.

Put Scaling and Calibration in the Right Order

The filter order matters because ESPHome applies filters from top to bottom.

If your calibration points were recorded after applying the voltage-divider multiplier, use:

filters:
  - multiply: 4.7037
  - calibrate_linear:
      - 4.930 -> 5.000
      - 11.820 -> 12.000

If you calibrated directly from raw ADS1115 voltage, place the calibration before the engineering-unit conversion instead. The important thing is that the numbers in calibrate_linear match the value that reaches that filter stage.

Three or More Calibration Points

ESPHome’s linear calibration filter can use multiple reference points. That is useful when the sensor or analogue front end is not perfectly linear across its range.

filters:
  - calibrate_linear:
      - 0.102 -> 0.0
      - 1.241 -> 5.0
      - 2.398 -> 10.0

For a genuinely nonlinear sensor, use the component-specific conversion formula or a polynomial calibration only when the physical behaviour justifies it. Do not use a complicated calibration curve merely to hide unstable wiring or noise.

Calibration Example: 0–10 V Sensor through a Divider

Suppose a 0–10 V pressure transmitter is divided by 3.3 so the ADS1115 sees approximately 0–3.03 V. After scaling, your calibration reference gives:

ESPHome scaled voltage   True voltage
0.050 V                  0.000 V
5.030 V                  5.000 V
10.070 V                 10.000 V

You can calibrate the reconstructed voltage:

filters:
  - multiply: 3.3
  - calibrate_linear:
      - 0.050 -> 0.000
      - 5.030 -> 5.000
      - 10.070 -> 10.000

Then a second template sensor can convert 0–10 V into pressure, tank level or whatever the transmitter represents.

Differential Measurement Does Not Automatically Remove Ground Noise

Differential measurement rejects voltage that appears identically on both inputs better than a single-ended measurement, but the complete analogue design still matters.

If your sensor ground carries relay current, switching noise or large voltage drops, connecting the ADS1115 to the same poor grounding arrangement can still produce unstable readings. Keep analogue return paths separate from high-current loads where practical and join grounds thoughtfully.

The ADS1115 is a better ADC than the ESP32’s internal ADC for many slow precision measurements, but it cannot compensate for a badly designed analogue front end.

Can ADS1115 Measure Negative Voltage?

The ADS1115 can return a negative differential result when the negative input is at a higher voltage than the positive input. That does not mean an analogue pin can safely go several volts below ground.

For example, these values are conceptually valid on a 3.3 V-powered system:

A0 = 1.45 V
A1 = 1.50 V
A0 - A1 = -0.05 V

Both physical pins remain safely inside the supply rails, while the measured differential voltage is negative.

This is very different from applying -0.05 V or -2 V directly to an analogue pin relative to ADS1115 ground.

Four Single-Ended Channels Example

A single ADS1115 can expose all four channels independently:

ads1115:
  - address: 0x48
    id: ads_hub

sensor:
  - platform: ads1115
    ads1115_id: ads_hub
    multiplexer: A0_GND
    gain: 4.096
    name: "Analog 0"

  - platform: ads1115
    ads1115_id: ads_hub
    multiplexer: A1_GND
    gain: 4.096
    name: "Analog 1"

  - platform: ads1115
    ads1115_id: ads_hub
    multiplexer: A2_GND
    gain: 2.048
    name: "Analog 2"

  - platform: ads1115
    ads1115_id: ads_hub
    multiplexer: A3_GND
    gain: 0.512
    name: "Analog 3"

Each channel can use a different gain because ESPHome reconfigures the ADS1115 multiplexer and PGA for each requested measurement.

Why a Multiplexed ADC Is Not Four Simultaneous ADCs

The ADS1115 has one converter behind an input multiplexer. It samples one selected channel configuration at a time.

For slowly changing sensors this does not matter. For phase-sensitive waveform measurements or multiple AC channels that need truly simultaneous sampling, one ADS1115 is not equivalent to four independent ADCs.

This distinction matters if you are trying to calculate phase relationships, power factor or simultaneous multi-channel waveforms. For Home Assistant environmental sensors, battery voltages and ordinary 0–10 V signals, multiplexing is normally completely acceptable.

ADS1115 vs ESP32 Internal ADC

FeatureADS1115ESP32 internal ADC
Nominal resolution16 bitTypically up to 12 bit
ReferenceInternal precision referenceChip-dependent SAR ADC calibration
Channels4 external multiplexedSeveral GPIO-dependent channels
PGAYesNo equivalent external PGA
Differential inputsYesNormally single-ended in ESPHome use
Maximum sample rate860 SPSMuch faster for suitable use cases
Best fitSlow precision measurementsSimple onboard analogue sensing

The ADS1115 is attractive when you need repeatability, low-level signals or more analogue channels. The ESP32’s own ADC remains perfectly reasonable for many basic sensors and avoids extra hardware.

Common Problems

SymptomLikely cause / first check
Voltage clips at a fixed valueSelected PGA range is too small for the signal.
Reading has poor resolutionPGA range is much larger than the actual signal.
ADS1115 damaged by a 5 V sensorPGA range was confused with safe absolute pin voltage.
Differential reading is negativeNegative input is at a higher voltage than positive input; may be correct.
Differential measurement is unstableCheck source impedance, grounding, common-mode level and analogue noise.
Battery reading is consistently lowDivider tolerance/loading; calibrate against a reference meter.
CT clamp gives poor waveform dataEnable continuous_mode and use an appropriate sample rate.
I²C scan does not find 0x48Check wiring and ADDR pin; device may be at 0x49/0x4A/0x4B.
High-value divider gives incorrect resultADS1115 input impedance may be loading the source.
Four channels seem delayedADS1115 is one multiplexed converter, not four simultaneous ADCs.

Recommended ESPHome Settings by Application

ApplicationGainSample rateMode
0–3.3 V sensor4.09664–128 SPSSingle shot
Battery divider4.09632–128 SPSSingle shot
0–1 V low-level sensor1.02464–128 SPSSingle shot
Small differential signal0.256–1.024128–860 SPS as neededSingle shot or continuous
CT clamp sourceFront-end dependent860 SPSContinuous
Slow pressure/level transmitterMatch conditioned voltage32–128 SPSSingle shot

These are starting points, not universal settings. Choose the gain from the actual voltage delivered to the ADS1115 after all conditioning and dividers.

Recommended Calibration Process

  1. Verify the maximum signal cannot exceed the safe ADS1115 input range.
  2. Select the smallest PGA range that covers the full expected signal.
  3. Use a stable reference or calibrated multimeter.
  4. Record at least two well-separated reference points.
  5. Apply voltage-divider or sensor scaling consistently.
  6. Add calibrate_linear using the measured and true values.
  7. Check one or more intermediate points after calibration.
  8. Only then add moving averages or display smoothing if required.

Calibration should correct a stable measurement. If the raw value wanders, jumps or changes when a relay switches, fix the analogue hardware and grounding before fitting a calibration curve.

Which Gain Should You Use?

For most 3.3 V ESP32 sensor projects, use ±4.096 V for 0–3.3 V inputs. Move to ±2.048, ±1.024, ±0.512 or ±0.256 V only when the conditioned signal is genuinely smaller and guaranteed not to exceed that range.

The ±6.144 V setting provides maximum headroom, but it does not let a 3.3 V-powered ADS1115 safely measure 6 V directly. That distinction is the single most important thing to remember when using the ADS1115.

Related ESP32 Analogue and Energy Guides

External Resources

Share your love