ADS1115/Why a separate chip/01. Why not analogRead
Why a separate chip · 01 of 11

Why not analogRead

Your board already has an analog input, and for a knob it is fine. For a battery, a load cell or a thermocouple it is twelve bits spread over three volts, bent at both ends, and moving when the radio transmits. This is what the ADS1115 is instead.

The problem is not the bit count

A microcontroller's analog input turns a voltage into a number by dividing its whole range into steps. The ESP32 divides about 3.1 V into 4096 of them, so one step is around 760 µV. That number does not change when your signal gets smaller. Measure a sensor that swings 50 mV and you are working with sixty-odd steps, out of the four thousand the chip has.

The ADS1115 does something different: it moves its range down to fit the signal. Six ranges, from ±6.144 V down to ±0.256 V, and all sixteen bits are spent inside whichever one you pick.

How many readings you get out of the signal you have
signal swings 50 mV
How far your signal actually swings50 mV
ESP32 step
756.8 µV
ADS1115 step
7.81 µV
Finer by
97×
The difference is the range, not the bit count. The built-in converter always spreads its 12 bits over 3.1 V, so a small signal uses a small corner of it. The ADS1115 moves the range down to ±0.256 V and spends all sixteen bits there — 97 times finer for the same measurement.

Drag the slider down to a small signal and watch the two numbers separate. That gap is not sixteen versus twelve. It is sixteen bits spent where the signal is, against twelve spread over a range mostly full of nothing.

And the built-in one is bent

Resolution is the easy half. The harder half is that a microcontroller's converter shares a die with a radio, a CPU and a switching regulator, and it shows:

  • The ends of the range do not work. On a classic ESP32 the reading sticks near zero below about 0.15 V and flattens out above roughly 3.1 V. The top and bottom tenth of your range are not measurements.
  • It is not linear in between. The step size varies across the range, which is why Espressif burns per-chip calibration data into every part and why analogReadMilliVolts exists.
  • On the original ESP32, ADC2 stops working when Wi-Fi starts. The radio takes that converter. Half the analog pins go quiet the moment you connect.

The ADS1115 has its own reference, its own oscillator and its own package, three millimetres away from all of that. Its errors are specified and they are small: 0.01% typical gain error, and enough common-mode rejection at 50 and 60 Hz to ignore mains hum.

Where each one belongs

What you are measuringUse
A knob, a light sensor, a resistor ladder of buttonsThe built-in ADC
Anything you will put a unit on — volts, grams, °CThe ADS1115
A signal that swings less than about 100 mVThe ADS1115, and a narrow range
Something changing faster than a few hundred times a secondThe built-in ADC

The last row is the honest limit. The ADS1115 tops out at 860 conversions a second and each one has to be fetched over I²C. It is a precision part, not a fast one.

What you gave up

Two GPIO pins, which the bus was probably already using, and a few milliseconds per reading. What you get back is a number with a unit on it that means the same thing tomorrow, on a different board, at a different temperature.

When it does not work

My analogRead values jump around by twenty or thirty

That is normal for a built-in converter and it is why averaging is the first thing every ESP32 example does. The ADS1115 does the averaging inside the chip, at the data rate you choose, which is a better place to do it because it happens before the number is made rather than after.

Do I still need the board's own ADC pins for anything?

Yes, for anything fast or anything you do not care about precisely — a light-dependent resistor deciding whether it is dark, a knob, a button read as a resistor ladder. The built-in converter is far quicker to read: no I²C transaction, no conversion to wait for. Use it where speed matters more than accuracy.

Is a 12-bit ADC really only 12 bits?

Usually less. The bit count is how finely the number is divided, not how much of it is signal. An ESP32 reading a still voltage typically moves over several counts on its own, so a few of those twelve bits are noise before anything else goes wrong. The same is true of the ADS1115 at its fastest settings, which is what /manuals/ads1115/data-rate-and-noise is about.

Where this goes next

And where half of them go the moment you measure against ground.

What 16 bits buys you

Edit this page — content/books/ads1115/why-not-analogread.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum