HW Interview
BX-02 · Chapter 14 · Bonus: Topics Readers Were Asked

Choosing ADC voltage divider resistor values

Level
●● onsite technical
Track
Embedded & wearables
Really testing
Turning pin leakage, sampling charge and battery drain into one resistor choice, with numbers.

Key number. Reading a 3-cell pack (12.6 V max) with a 12-bit, 3.3 V ADC through a 300 kΩ / 100 kΩ divider with 100 nF on the lower leg. The pin leaks up to ±100 nA, and the SAR samples 10 pF at 1 kS/s. Result: 300k/100k with 100 nF: 9 LSB of leakage error, 31.5 µA of drain; tolerance is the bigger error. Worked out below

The question and its full answer: in the book, page 324: what to say first, the mechanism, the numbers you would say out loud and the follow-ups. This page has the arithmetic: worked numbers, calculators and a longer explanation. About the book →

Worked numbers

The book keeps the mechanism and the numbers you would say out loud. The arithmetic is here, worked from the inputs to the result. Every number in this section is computed from the stated inputs.

A typical case. Reading a 3-cell pack (12.6 V max) with a 12-bit, 3.3 V ADC through a 300 kΩ / 100 kΩ divider with 100 nF on the lower leg. The pin leaks up to ±100 nA, and the SAR samples 10 pF at 1 kS/s.

  1. Ratio: 100k/400k = 1/4, so 12.6 V reads 3.15 V.
  2. Source resistance at the pin: 300k ‖ 100k = 75 kΩ. Leakage error: 100 nA × 75 kΩ = 7.5 mV, 9.3 LSB (1 LSB = 806 µV), 30 mV at the pack.
  3. Without the 100 nF: 10 pF through 75 kΩ needs (12 + 1)·ln2 = 9 time constants, 6.76 µs. The 100 nF supplies the charge instead: 10 pF/100 nF moves the pin by 1 part in 10,000.
  4. Switched-capacitor load: 1/(fs·Cs) = 100 MΩ, so the reading is 0.075% low at most.
  5. Battery drain: 12.6 V / 400 kΩ = 31.5 µA. If that is too much, switch the top with a FET and wait 9 × 75 kΩ × 100 nF = 67.6 ms before sampling.
  6. 30 kΩ over 10 kΩ instead: leakage error 750 µV, but 315 µA of drain.
  7. Two 1% resistors can put the ratio off by (1 − 1/4) × 2% = 1.5%; use 0.1% parts or calibrate.

Result. 300k/100k with 100 nF: 9 LSB of leakage error, 31.5 µA of drain; tolerance is the bigger error.

Sanity check. Keep the divider current at least 100 times the leakage. Switch the high side; a low-side switch lets R1 pull the pin above the supply.

Calculators for this question

Run your own numbers. Each tool shows its formula and a worked example.

Resistor divider into an ADC

Going deeper: sizing the ADC voltage divider

The longer explanation the book has no room for: where people go wrong, and how to say it in the room.

Two limits, one resistor value. Pin leakage and sampling charge flow through R1‖R2 and set the upper limit. Battery drain sets the lower limit. Pick the largest values the error budget allows, then add a capacitor across the bottom resistor.

What the capacitor does. It hands each sample its charge, so the divider only has to replace the average. The cost is time: the node needs about nine time constants to settle at 12 bits after the divider is switched on.

Switch the high side. If you power-gate the divider, put the switch on top. A low-side switch leaves R1 connected to the battery and lets it pull the pin above the ADC's supply.

Where people go wrong

Say it in the room: "Leakage times R1‖R2 caps the values, battery drain floors them, a capacitor feeds the sampler, and tolerance is usually the biggest error."

Errata

None known. All errata

Questions or corrections

Ask about BX-02

Related

← BX-01 Op-amp errors the ideal rules hideBX-03 Resistor technologies and their limits →