Source code coming soon. The GitHub repository is private for now and opens to everyone very soon.
BetterSPICE Beta 0.8.1 Join the beta Download soon
Part VII  Design calculatorsReferenceContentsIndex
49

Voltage divider

Two resistors that give a fraction of a voltage: a feedback divider, a reference, a battery or mains monitor into an ADC. The Simple view works out any one of the supply, R1, R2 and the output from the other three, or picks the best standard pair. The Advanced view designs the divider for an ADC input over tolerance, tempco and temperature, with its ratings and a surge. Group Circuit. Search words include divider, ratio, feedback, e24, e96, vout, r1 and r2.

The window, the Simple and Advanced views, full screen and the place buttons are in The calculator window.

49.1The voltage divider

The voltage divider solving R1: 5 V, R2 10 kΩ and Vout 3.3 V give R1 5.1515 kΩ, with the nearest E24 and E96 values, the formulas, the circuit and the outp
Figure 49.1The voltage divider solving R1: 5 V, R2 10 kΩ and Vout 3.3 V give R1 5.1515 kΩ, with the nearest E24 and E96 values, the formulas, the circuit and the output against R2.
The voltage divider
ChoiceOptionsWhat it does
ModeSolve for any value (default), Pick from a seriesSolve: fill in three of Vs, R1, R2 and Vout and press SOLVE on the fourth. Pick: the best pairs of a series for an output, ranked by the error they give.
SeriesE12, E24, E96Pick mode only.
Load on the outputNone, ResistorResistor adds a load across R2 (R2′ = R2 ∥ RL) in either mode. It counts in every result.
The voltage divider
FieldUnitDefaultWhat it does
Supply voltage (Vs)V5SOLVE. Type 5, 3V3 or 3.3.
R1 (top)Ω, kΩ, MΩ4.7 kΩSOLVE. Reads the first selected resistor.
R2 (bottom)Ω, kΩ, MΩ9.1 kΩSOLVE. Reads the second selected resistor.
Output voltage (Vout)V3.2971 (solved)SOLVE, solved when the calculator opens.
Input voltage, Output voltageV5, 3.3Pick mode.
Total resistance, aboutΩ, kΩ, MΩ10 kΩPick mode. Sets the current: pairs within half a decade of it are listed.
LoadΩ, kΩ, MΩ100 kΩWith Load on the output = Resistor.

The formulas: Vout = Vs R2′ / (R1 + R2′), I = Vs / (R1 + R2′), Rout = R1 R2 / (R1 + R2). With a load, R2′ = R2 RL / (R2 + RL). When Vs, R1 or R2 is solved, its own formula is shown: Vs = Vout (R1 + R2′) / R2′, R1 = R2′ (Vs − Vout) / Vout, R2′ = R1 Vout / (Vs − Vout), and with a load R2 = R2′ RL / (RL − R2′).

The voltage divider
ResultWhat it is
Input (Vs), R1 (top) or R2 (bottom)The solved value, five digits, first and in orange.
Output (Vout)With the load, if any.
Ratio Vout / Vs
Divider currentVs / (R1 + R2′).
Power in R1, Power in R2I² R1 and Vout² / R2.
Output resistanceR1 ∥ R2, the resistance a load on the output sees (without the load).
Power in the load, Output with no loadWith a load: Vout² / RL, and Vs R2 / (R1 + R2).
Total powerVs × I.
Pick modeR1 (top) and R2 (bottom) of the best pair, Output, Error (signed, %), Divider current, Divider power, and a table Best E24 pairs (R1, R2, Output, Error, Current, Power) with the best row marked.

A solved R1 or R2 that is not a standard value gets a note: "The R1 worked out is not a standard value. The nearest E24 values are 5.1 kΩ and 5.6 kΩ, the nearest E96 5.11 kΩ and 5.23 kΩ. Pick from a series finds the best pair." The plot Output against R2 (log R2, two decades around it) marks the working point. Pick mode searches every R2 of the series from a hundredth of the total to 3.2 times it, takes the two standard values around the exact R1, keeps pairs within half a decade of the total, works out each with the load, and lists the ten with the smallest error (equal errors: the total nearer the one asked first).

The voltage divider
MessageWhen it shows
"The load of 10 kΩ is close to the divider resistance (13.7 kΩ), so the output moves with it. A lower total resistance or a buffer keeps it steady."A load under 10 × (R1 + R2).
"The input voltage (Vs) cannot be negative. Keep the supply positive and swap the resistors if the polarity is the other way."A negative value. Also for R1, R2 and Vout.
"R1 cannot be zero: a resistor of zero ohms is a wire."R1 or R2 is 0.
"Vout (6 V) is above Vs (5 V). A divider only gives an output below its input."Vout above Vs.
"Vout equals Vs. That needs R1 at zero ohms (a wire) or R2 open, so there is no divider to size."Vout equal to Vs.
"The output voltage has to be above zero to work a resistor out from it. At zero volts R2 would have to be a short."Vout at 0 while solving a resistor.
"With R1 = 4.7 kΩ and a load of 1 kΩ the output cannot reach 3.3 V. The most it gives is … with R2 open. Raise the load, lower R1 or ask for a lower output."Solving R2 with a load that cannot give the output.
"The … is not a number. / The load has to be above zero ohms. / The input voltage has to be above zero."The other impossible inputs.

An impossible input shows one message and no tiles, and no buttons.

The voltage divider
ButtonWhat it does
Place and run liveV1 at Vs, R1, R2 and the load if any, OUT probed, in the live view. The live view shows 3.2971 V on OUT.
Place and check the operating pointThe same circuit and an operating point. Measurement Divider output, V(OUT), within ±0.1 % of the calculator.
Apply to selected resistors (R3 top, R4 bottom)With two resistors selected: R1 into the first, R2 into the second.

With two resistors selected, the picker offers the divider with their ratio, and it opens in Solve mode with R1 from the first and R2 from the second. Standard values are from IEC 60063.

Try it
The textbook divider and a 3.3 V output
  1. Open the voltage divider (Ctrl+Shift+C, type divider) and press Reset to the defaults.
  2. Read the tiles: Vs 5 V, R1 4.7 kΩ, R2 9.1 kΩ.
  3. Press SOLVE on R1, then type Vs 5, R2 10k and Vout 3V3.

You should seeFirst: Output (Vout) 3.2971 V, ratio 0.65942, current 362 µA, 617 µW in R1, 1.19 mW in R2, output resistance 3.1 kΩ, 1.81 mW in all. Then: R1 5.1515 kΩ, 330 µA, and the note naming 5.1 kΩ and 5.6 kΩ (E24) and 5.11 kΩ and 5.23 kΩ (E96).

Try it
Pick a pair, then load it
  1. Set Mode to Pick from a series: 5 V to 3.3 V, about 10 kΩ, E24.
  2. Set Load on the output to Resistor and type 10k.

You should seeThe best E24 pair is 4.7 kΩ over 9.1 kΩ: 3.2971 V, −0.088 %. With the 10 kΩ load it becomes 2.7 kΩ over 11 kΩ (3.2993 V, −0.020 %, 630 µA) and the amber warning says the load is close to the divider resistance.

49.2Advanced: a divider into an ADC

The voltage divider’s Advanced view in full screen: 12 V to 2.5 V into a 12-bit ADC, the best E96 pairs, the parts, the worst case, the ratio error against
Figure 49.2The voltage divider’s Advanced view in full screen: 12 V to 2.5 V into a 12-bit ADC, the best E96 pairs, the parts, the worst case, the ratio error against temperature, the Monte Carlo, the ADC sampling and the checks.
Advanced: a divider into an ADC
ChoiceOptionsWhat it does
ResistorsSeries search, Typed valuesSeries search sets R1 and R2 from the best pair (marked SOLVED). Typing in R1 or R2 switches to Typed values.
LoadNone, Resistor, ADC inputWhat the output drives. None: an ideal voltmeter. ADC input: pin leakage, the sampling capacitor and the clamp diode.
TempcoTwo discrete, NetworkTwo resistors with their own tolerance and TCR, or a matched network with a ratio tolerance and tracking.
Advanced: a divider into an ADC
TabIts dotCards
DesignThe worst check.Result, Best E96 pairs, Parts, Checks.
AccuracyGreen when the worst error is within the error allowed, else amber.Worst case, Ratio error vs temperature, Tolerance spread (Monte Carlo).
ADC inputWith an ADC load: green when the sampling and the leakage error are each within ½ LSB, else amber.ADC sampling, Error vs divider resistance, Checks.
Verify in simulationNone.Calculator vs simulation and the buttons.
Advanced: a divider into an ADC
FieldUnitDefaultWhat it does
Input voltage Min / Nominal / MaxV10.8 / 12 / 13.2Group Input and target. The output corners are worked out at all three.
Vout at nominalV2.5
Total aboutkΩ50The R1 + R2 the series search aims for.
SurgeV36A transient on the input, for the clamp and R1 checks.
R1, R2kΩ39.2, 10.2 typed (SOLVED from the search)
Error allowed±%1Of the output.
SeriesE24, E96Group Resistors.
Tolerance (Ratio tol for a network)±%0.1
TCR (Tracking for a network)ppm/°C25 (5)
Current maxµA300The current budget.
T min, T max°C−40, 85
Package0402, 0603, 0805, 1206, 2512Rating at 70 °C and working voltage: 0402 63 mW 50 V, 0603 100 mW 75 V, 0805 125 mW 150 V, 1206 250 mW 200 V, 2512 1 W 500 V. Derated linearly to 0 at 155 °C.
Monte Carlo distributionNormal, Uniform
Bits, Full scale, V12, 3.3Group ADC input. Its badge is the sampling error in LSB, green at ½ LSB or less.
Pin leakageµA0.1
Sample C, Switch RpF, kΩ5, 1The ADC’s sampling capacitor Cs and switch Rsw.
Sample time, Sample rateµs, kHz1.5, 10tacq and fs.
Cf at pinnF100A capacitor at the pin. 0 for none.
Clamp at, Clamp maxV, mA3.6, 5The pin’s clamp diode and its injection limit.
Cs initial state0 V (muxed or reset), Last sampleA multiplexed or reset input starts each sample from 0 V.
LoadkΩ1000Group Load resistor, with Load = Resistor.

How it works it out. The series search tries every R2 of the series from a fortieth of the total to 1.2 times it with the two standard R1 around the exact value, keeps pairs within half a decade of the total, includes a resistor load (not the ADC), and lists the eight with the smallest error. Click a row to use the pair. The ratio is k = R2′ / (R1 + R2′), the source resistance Rth = R1 ∥ R2 ∥ RL, and 1 LSB = full scale / 2bits.

  • Worst case: two discrete resistors at all 2⁴ corners of their tolerance and TCR, a network with R2 at its ratio tolerance and tracking, at 25 °C, T min and T max. The output corners at Vin min, nominal and max add the leakage drop (Ileak × Rth) and the sampling error, and give the ADC codes.
  • Worst error is the sum of the tolerance, tempco, leakage and sampling errors, each at its worst. It is not a root-sum-square.
  • Sampling: with no Cf, Cs charges through Rth + Rsw for tacq, and the error is V e−tacq / ((Rth + Rsw) Cs). With Cf, each sample takes charge from Cf and the divider tops it up: the steady state of charge sharing at the sample rate (when Rth Cf is much longer than 1/fs the error is Rth Cs fs V, and a larger Cf does not lower it). The largest Rth for direct sampling is tacq / (Cs (bits + 1) ln 2) − Rsw.
  • Monte Carlo: 3000 seeded draws at 25 °C (tolerance) and at T max (tolerance and TCR), shown as two histograms in LSB.
  • Ratings: the power in R1 at Vin max and at the surge against the package rating at T max, the surge voltage against its working voltage, and the clamp current at the surge (Vsurge × k − Vclamp) / Rth. The smallest package that covers both is named.
Advanced: a divider into an ADC
ResultWhat it is
R1, R2The pair, with series, tolerance and TCR (or tracking).
OutputAt the nominal input, and how far from the target.
Worst error% of the output and in LSB. Amber above the error allowed.
RthThe resistance the ADC pin sees.
CurrentWith the total power. Amber above the budget.
Step to ½ LSB, or Sample settlesADC with Cf: τ = Rth Cf and the time to settle to ½ LSB after a step. Without Cf: the time Cs needs. Other loads: R1 power and its rating.
Surge 36 VThe clamp current (red above the pin limit), or the pin voltage.

The Parts card lists R1 and R2 with series, tolerance and TCR, the R1 package with its power and surge rating, Cf (C0G or X7R, at least twice the full scale), the ADC sampling time to set, the network ratio to five decimals, the worst error and the clamp current, with Copy. The plots: Ratio error vs temperature (worst high, worst low, tolerance alone at 25 °C, the allowed error in red), Tolerance spread, ADC sampling (the charge error against time, or the pin voltage over three samples with Cf) and Error vs divider resistance (each error against R1 + R2 at the same ratio from 1 kΩ to 10 MΩ, with the current budget as a red band and the present total marked).

Advanced: a divider into an ADC
CheckValue and limitPassesMarginalFails
Output at Vin max, worstThe highest output · ADC full scaleAt least 2 % of full scale spare0 to 2 % spareClips
Error at Vin nominal, worst% · allowed, with LSBWithin the allowed errorUp to 1.25 × itMore
Divider currentA · budgetWithin the budgetUp to 1.1 × itMore
R1 power at Vin maxW · package rating at T maxHalf the rating or lessUp to the ratingOver
R1 power at the surgeW · ratingWithin the ratingUp to 2 × itMore
R1 voltage, surgeV · working voltageRating ≥ 1.25 × itUp to the ratingOver
Clamp current, surge (ADC)A · pin limitNo clamping, or half the limitUp to the limitOver
Sampling error (ADC)LSB½ LSB or lessUp to 2 LSBMore
Leakage error (ADC)LSB · Ileak × Rth½ LSB or lessUp to 2 LSBMore
Cs settling through Rsw (with Cf)time · tacqtacq ≥ 1.2 × ittacq ≥ itShorter
Rth, direct sampling (no Cf)Rth · its maximumWithin itUp to 2 × itMore: add Cf
Load vs divider (resistor load)RL · R1 ∥ R210 × or more3 × to 10 ×Less
Advanced: a divider into an ADC
MessageWhen it shows
"Worst-case output at Vin max is 3.54 V, above the 3.3 V full scale. Lower the target to 2.92 V."The highest output clips.
"Sampling error 1.8 LSB. Each sample takes Cs·V from Cf, and the divider replaces it at an average 125 nA. With Rth·Cf ≫ 1/fs the error is Rth·Cs·fs·V and a larger Cf does not reduce it. Use Rth ≤ 3.23 kΩ, a lower sample rate or a buffer."Sampling error above ½ LSB with Cf.
"Without Cf, Rth 84.3 kΩ does not settle Cs 5 pF within 1.5 µs. Rth ≤ 32.3 kΩ is required. Add Cf (10 nF to 100 nF) or lengthen the sampling time."The same without Cf.
"Pin leakage 100 nA through 10.9 kΩ shifts the reading by 1.3 LSB. Lower the divider resistance or add a buffer."Leakage above ½ LSB.
"A 36 V surge drives … into the pin clamp diode, limit 5 mA. Raise R1, or add a series resistor and an external clamp."Clamp current above the limit.
"R1 dissipates … at …, above the 0603 rating of … at 85 °C. Use a larger package or check the pulse rating."R1 over its rating.
"Divider current … exceeds the 300 µA budget. Use R1 + R2 ≥ …. Leakage and sampling error rise with it."Over the current budget.
"No pair for … from …. The output must be below the input. Typed values shown."The series search finds nothing.

Verify in simulation checks Output at Vin nominal (operating point, V(OUT), with the pin leakage placed, ±0.1 %), Worst high at T max (a worst-case tolerance run of the operating point with tol and tc1 on R1 and R2 in the direction that raises the output, at T max: every corner inside), and for an ADC the Sampled value (a transient with the ADC’s switch and Cs at the sample rate, V(CS) at the end of the last sample, ±10 % of the dip). Output over Vin is calculator only: the operating point checks the ratio.

Advanced: a divider into an ADC
ButtonWhat it does
Place and run operating pointV1 at the nominal input, R1, R2, the load or Cf, and for an ADC a current source for the pin leakage. Measurement Divider output within ±0.1 % of the nominal output minus the leakage drop.
Place and run worst caseThe same with tol and tc1 on R1 and R2 (network: R2 carries the ratio tolerance and tracking), temp at T max, then a worst-case tolerance run of 200 runs (seed 1). Measurement Divider output at 85 °C, worst case between the lowest and highest corners.
Place and run samplingADC only: the sampling switch SW_S (Rsw), Cs, a switch that empties Cs between samples and a pulse source at the sample rate, run until the steady state (up to 400 samples). Measurement Sampled value (on Cs).
Place circuitThe divider with its source and load, OUT probed, no analysis.
Apply to selectionWith two resistors selected: R1 to the first, R2 to the second.

The Monte Carlo histograms stay calculator only: the worst case bounds them.

Advanced: a divider into an ADC
SimpleAdvanced
Supply voltage (Vs), or Input voltageInput voltage Nominal (Min and Max follow at ±10 % until you type them)
Output voltage (Vout)Vout at nominal
R1, R2, Load, Total resistanceR1, R2, load R, Total about
Mode Pick from a seriesResistors Series search
Try it
12 V into a 12-bit ADC
  1. Open the voltage divider and press Advanced. The defaults: 10.8 to 13.2 V in, 2.5 V out, E96, 0.1 %, 25 ppm/°C, a 12-bit 3.3 V ADC with 100 nF at the pin.
  2. Read the Best E96 pairs and the tiles, then the Checks.

You should seeThe best pair is 52.3 kΩ over 13.7 kΩ: 2.4909 V, −0.364 %, 182 µA. Worst error 0.52 % (16.0 LSB), Rth 10.9 kΩ, step to ½ LSB 9.78 ms (τ 1.09 ms), and 360 µA into the clamp at the 36 V surge. Two checks are amber: Sampling error 1.8 LSB and Leakage error 1.3 LSB, with the warnings that say to use Rth ≤ 3.23 kΩ or a buffer. Place and run operating point passes with OUT at 2.4898 V.

Try it
A divider that clips
  1. Type Vout at nominal 3.2, Total about 200, Current max 50, Surge 60, and Cf at pin 0.

You should seeFive checks fail: the output at Vin max reaches 3.54 V and clips, the error is 3.62 % (143.8 LSB), the sampling error is 118 LSB, the leakage 10.5 LSB, and Rth 84.3 kΩ is over the 32.3 kΩ for direct sampling. The warnings say to lower the target to 2.92 V and to add Cf.

Sources. IEC 60063 values. The ADC sampling follows Microchip’s ADC application notes, and the charge-sharing steady state reduces to Rth Cs fs V. The tests check the best E96 pair against a search of every E96 pair, the worst case against the 2⁴-corner closed form, and the placed circuits against bspice’s operating point, worst case and sampling runs.