How it works
Vout = Vin × R2 / (R1 + R2)
R1 is the high side, R2 the low side. With a load (an ADC input, another stage), R2 is effectively in parallel with it:
R2' = R2 × RL / (R2 + RL)
Find mode walks every R2 in the chosen series from 1 Ω to 10 MΩ, computes the ideal R1, snaps it to the nearest standard value and ranks the pairs by error. Only pairs with a total of 1 kΩ to 1 MΩ are kept: lower wastes current, higher makes the divider sensitive to leakage and ADC sampling.
Practical notes
- For an ADC input, keep the divider’s source impedance (R1 ∥ R2) below what the ADC datasheet allows for your sampling time, or add a capacitor at Vout.
- Resistor tolerance adds directly to the error: two 1 % parts can shift the ratio by up to about 2 %.
- A divider is not a power supply: Vout sags as soon as the load draws current.