Sitemap

Resistor selection tool

2 min readSep 6, 2026

--

There are many situations where the design of the circuit is constrained by the BoM. Say that in the design phase, it is observed that a lot of different resistor values have to be used. Theoretically, it should be fine, but practically speaking, more the different number of resistors, more the cost as vendors provide resistors in bulk quantities and having different values of resistors in bulk quantities is not profitable.

This tool allows the user to provide a list of available resistor values in their BoM and searches for the most optimal values of resistors for a given configuration, which gives equivalent resistance closest to the target value.

The source code can be found here:

circuit-design-tools/resistor-design-tools/resistor-selector.py at main · PatrickAJoseph/circuit-design-tools

Working of the tool

The tool expects the user to provide a set of available resistor values as a text file. It also expect the user to provide the required resistor network configuration. It can be either a single resistor (S), two resistors in series (2S), two resistors in parallel (2P), two resistors in series and one resistor in parallel with the series combination (2S1P), two resistors in parallel followed by a resistor in series (2P1S), three resistors in series (3S), three resistors in parallel (3P). If no configuration is provided, the tool searches for the optimal configuration which gives effective resistance closest to the target value. The tool is written in Python.

For each configuration, the tool calculates the effective resistance for combination of all possible values, keeps track of the minimum error and when minimum error is updated everytime, the selected resistor values are stored in memory.

Get Patrick A Joseph’s stories in your inbox

Join Medium for free to get updates from this writer.

Using the tool:

Suppose the user has to use E6 series resistor values (Resistor Series Values-E3, E6, E12, E24, E48 & E96) for getting an equivalent resistance of 12560.0 ohms and the user desires to use 2P combination, then the command is:

python resistors-selector.py -r res.txt -t 12560.0 -c 2P

The res.txt text file contains all values of E6 resistor series. The output of the above command is as follows:

[1.0, 1.5, 2.2, 3.3, 4.7, 6.8, 10.0, 15.0, 22.0, 33.0, 47.0, 68.0, 100.0, 150.0, 220.0, 330.0, 470.0, 680.0, 1000.0, 1500.0, 2200.0, 3300.0, 4700.0, 6800.0, 10000.0, 15000.0, 22000.0, 33000.0, 47000.0, 68000.0, 100000.0, 150000.0, 220000.0, 330000.0, 470000.0, 680000.0, 1000000.0, 1500000.0, 2200000.0, 3300000.0, 4700000.0, 6800000.0, 10000000.0]
Configuration: 2P
Target resistance: 12560.0
Actual resistance: 12289.156626506025
Required values: [15000.0, 68000.0]
Error: 270.8433734939754
Percentage error: 2.1563962857800587 (%)

If no configuration is provided, then, the tool automatically choses the optimal configuration for the user.

python resistors-selector.py -r res.txt -t 12560.0
Available resistor values: 
[1.0, 1.5, 2.2, 3.3, 4.7, 6.8, 10.0, 15.0, 22.0, 33.0, 47.0, 68.0, 100.0, 150.0, 220.0, 330.0, 470.0, 680.0, 1000.0, 1500.0, 2200.0, 3300.0, 4700.0, 6800.0, 10000.0, 15000.0, 22000.0, 33000.0, 47000.0, 68000.0, 100000.0, 150000.0, 220000.0, 330000.0, 470000.0, 680000.0, 1000000.0, 1500000.0, 2200000.0, 3300000.0, 4700000.0, 6800000.0, 10000000.0]
Best configuration: 3P
Target resistance: 12560.0
Actual resistance: 12547.528517110266
Required values: [15000.0, 100000.0, 330000.0]
Error: 12.471482889734034
Percentage error: 0.09929524593737288 (%)

--

--