Binary ADC Evidence

Ada audits binary ADC evidence — bit depth, voltage steps, divider scaling, and rounding

foundations
math-foundations
binary
adc
beginner
Ada ADA · CALCULATION AUDIT

Foundations · optional mathematics and physics

Binary ADC Evidence

A student tried to read a 12 V battery straight into an ESP32’s 12-bit ADC and destroyed it, because the part’s ceiling is 3.3 V, not 12 — range and resolution are independent. A 27 kOhm and 10 kOhm divider drops the source into range, and an ADC reading of 4000 reconstructs to 11.93 V. This audit carries the divider math through at full precision and asks whether that final 11.93 V survives when unrounded values are kept until the very last step.

Companion to the chapter Binary Number Systems — every number here comes from that chapter.

Bit depth, voltage steps, divider scaling, and rounding, ~4 minutes

Binary place value becomes physical when an ADC code stands for a voltage. The mathematics sets the code spacing; the circuit physics decides whether that code is safe and meaningful.

The working

1. Count the codes before interpreting the voltage. A 12-bit ADC has 212 = 4096 possible levels. If the hardware reports endpoint codes, those levels are labelled 0 through 4095.

levels = 212 = 4096; maximum endpoint code = 4096 - 1 = 4095

2. Use the full precision until the final display value. For the chapter's ESP32-style 3.3 V example:

ideal step = 3.3 V / 4096 = 0.000805664 V = 0.805664 mV
endpoint-code estimate for code 4000 = 4000 * (3.3 V / 4095) = 3.223443 V
divider ratio = (27 kOhm + 10 kOhm) / 10 kOhm = 3.7; battery estimate = 3.223443 V * 3.7 = 11.9267 V, rounded at the end to 11.93 V
Check Arithmetic What it proves
8-bit example 28 = 256 levels An 8-bit reading is coarse because one byte can encode only 256 distinct ADC states.
12-bit example 212 = 4096 levels A 12-bit ADC has 16 times as many levels as an 8-bit ADC: 4096 / 256 = 16.
10-bit to 12-bit improvement 212 / 210 = 4096 / 1024 = 4 Two extra bits make each ideal voltage step 4 times finer, not 2 times finer.
3.3 V, 12-bit ideal step 3.3 V / 4096 = 0.805664 mV The converter can distinguish sub-millivolt ideal steps, but only inside the 0 V to 3.3 V input range.
12 V battery divider safety 12 V * (10 kOhm / (27 kOhm + 10 kOhm)) = 3.24324 V The divider brings the nominal 12 V source below the 3.3 V ADC limit.

Audit rule: report rounded values for learners, but carry unrounded values through the calculation until the final result. That habit prevents a harmless display rounding from becoming a hidden arithmetic error.

Every number above is taken from the chapter's own binary ADC example and re-derived step by step.