You are here: Home Software ResistorCalc


A little Perl script to calculate resistor networks.


Resistor Calc is a little Perl project to make it easier to attain given resistance by networking resistors in series and parallel. It is designed to make choosing resistors easier by suggesting networks based off of a given set of available resistors.


  • Perl
  • Term::ReadKey


Simply download and extract the package somewhere. Then place mkResistorCache and resistorCalc somewhere on the PATH.


  1. Create a file containing the numeric values of all available resistors one per line. The order does not matter.
  2. Then create the cache for that file by executing something like
mkResistorCache /path/to/resistor/file 4

This will create a cache file that can be referred to by the name 'file' when running resistorCalc. It worthwhile to note that the depth parameter will increase the time it takes to create the cache exponentially depending on the size of the given resistor set. The script will prompt for confirmation if the number of possibilities exceeds 5M.

  1. To calculate the necessary resistor network to provide a given resistance run
resistorCalc file 101 1

This will provide suggestions that yield 101 Ohm give or take 1% ordered by the networks providing the least number of components to the most, limited by the maxdepth parameter of the mkResistorCache call, in our case 4. If a perfect match is achieved with less than 4 components, the remainder will be skipped.

It is possible to maintain many caches for example one for 1/4 watt, one for 1/2 watt or SMT resistors.

To explain how to read the results, consider the following example:

resistorCalc file 10101 1
You get 10000.00 from 10000
You get 10100.00 from 100 S 10000
You get 10100.99 from 10000 P 1000000 S 100 S 100

Because we specified a 1% range, we get several options. The grouping of the results is as follows:

(((10000 P 1000000) S 100) S 100)

To explain this more clearly the ASCII drawing below shows the resistor network described above:

---+           +--100--100---


You can get the latest version here

Document Actions

Copyright © 2007-2015 Mario Theodoridis. All rights reserved. Content licensed under AFL.   Impressum   Datenschutz
Content from the underlying Plone CMS is © 2000-2009 by the Plone Foundation