Binary ADC Evidence
Binary ADC Evidence
Ada audits binary ADC evidence — bit depth, voltage steps, divider scaling, and rounding
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.
See the relationship before changing it
The figure reads from left to right. The blue card is adc endpoint code. The middle card applies this page's rule. The green card is reconstructed battery voltage. Walk the arrows once: set the input, apply the rule, then read the result with its unit.
The retained audit below checks several chapter fixtures. This model keeps those stated values fixed and changes only adc endpoint code, so the numeric fixture does not switch without explanation.
Derive the baseline in four named moves
- 1
Name the input. The chapter baseline is 4000 code.
- 2
Name the relationship. battery voltage = code x 3.3 V / 4,095 x 3.7 divider ratio
- 3
Substitute with units. 4,000 x 3.3 / 4,095 x 3.7 = 11.93 V
- 4
Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.
Predict, then change adc endpoint code
Try Predict the direction of battery voltage = code x 3.3 V / 4,095 x 3.7 divider ratio. Test another adc endpoint code, then compare reconstructed battery voltage.
Observe A larger ADC code reconstructs a larger divided source voltage when the divider ratio stays fixed. Reset adc endpoint code to 4000 and compare reconstructed battery voltage.
Explain A larger ADC code reconstructs a larger divided source voltage when the divider ratio stays fixed.
Check yourself
What should you do before trusting a moved-control result?
What does this small model leave out?
Use the displayed 12 V battery, 27 kohm over 10 kohm divider, and 12-bit 3.3 V ADC as a fixed case; press Calculate to follow it.
The divider output reaches 3.24324 V and the recovered source rounds to 11.93 V only after full-precision arithmetic.
The resistor ratio protects the 3.3 V input while ADC bit depth controls code spacing; voltage range and resolution are independent constraints.
Technical boundaries
For the divider case, excluded from this fixed arithmetic are reference drift, resistor tolerance, ADC non-linearity, electrical noise, or firmware timing effects.
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.
2. Use the full precision until the final display value. For the chapter's ESP32-style 3.3 V example:
| 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.