Calculator program finds closest standard-resistor values
Edited by Brad Thompson
Francesc Casanellas, Aiguafreda, Spain -- EDN, February 3, 2005
Although it may not appear obvious to newcomers to the electronics-design profession, components' values follow one of several progressions that divide a decadewide span into equally spaced increments on a logarithmic scale. For example, when you plot the values of 1, 2.2, and 4.7 on a logarithmic scale, they divide the range 1 to 10 into three roughly equal increments (1... 2... 5). To meet requirements for greater precision, resistor manufacturers offer parts in several additional series. The most precise series divide a decade into 24, 48, or 96 increments by computing 10n/m, where n=1... (m–1), and m=24, 48, or 96, and then rounding the values to two or three digits. The results are the R24, R48, and R96 series and respectively contain 24, 48, or 96 values per decade.
You can use a Hewlett-Packard HP-48 or HP-49 calculator and one of the following programs written in RPN (Reverse-Polish Notation) to compute the nearest standard value that's closest to a required value. You enter a required resistor value, and the program returns the closest higher or lower value in the selected series. Table 1 lists a few examples.
Each program acts as an operator by processing the first line of the calculator's stack and returning the new value in the same line of the stack. The R48 and R96 series are mathematically exact, and their programs consist of only a single line of code. Listings show the code. The values of the older R24 series are not as strictly rounded, and the program is thus somewhat more complex.
Note that the values of other components, such as capacitors, inductors, and zener diodes, also follow preferred-value series, making these programs universally applicable. You can view an earlier version of a standard-value calculator for IBM-compatible PCs at a previous Design Idea. David Kirkby of the Department of Medical Physics, University College London, UK, wrote the program in C. EDN first presented it, "Resistance calculator yields precise values," in the Aug 3, 1995, issue. Note that certain portions of the software may require rewriting for better operation on today's PCs.
Check out our
Best of Design Ideas
section!
-
Thanks John-Paul. Actually my formula changed the log function to log10 and is adaptation of Herbert's posted below. You are correct that there is an error. Your formula, modified for OpenOffice, looks like this:
=IF(E7
Wayne Kirkwood - 2008-13-9 13:02:00 PDT -
Wayne,
I tried your formula in OpenOffice with a value of 1012 ohms, and it also rounded down to 1000 ohms instead of up to 1020 ohms. This isn't an isolated case; there are other values that get rounded wrong as well. Practically though, these errors may not be a big deal, unless you are trying to set some critical gain value.
John-Paul Bedinger - 2008-5-9 11:44:00 PDT -
I used this one (modified) to calculate mic preamp gain resistors ranging from 10 ohm to 10K and it seemed to be right on target:
"Here is a Microsoft Excel formula that converts an odd resistance value (R_in) into a standard 1% value: =ROUND(10^(INT(LOG(R_in))+(ROUND((LOG(R_in)- INT(LOG(R_in)))*96,0))/96),2-INT(LOG(R_in)))"
As mentioned previously I used log10 instead of log so that OpenOffice Calc evalutes it correctly.. I can't vouch for values
Wayne Kirkwood - 2008-2-9 14:32:00 PDT -
Has anyone tested this formula? I mean, values like 1.012ohm round down to 1ohm instead of up to 1.02ohm. Just FYI. I posted this some time ago, but a way to get around this is something like:
=IF(A1
John-Paul Bedinger - 2008-27-8 02:30:00 PDT -
"Here is a Microsoft Excel formula that converts an odd resistance value (R_in) into a standard 1% value: =ROUND(10^(INT(LOG(R_in))+(ROUND((LOG(R_in)- INT(LOG(R_in)))*96,0))/96),2-INT(LOG(R_in)))"
I've used Herbert's formula above and it works very well in Excel. Unfortunately OpenOffice Calc returns an Err:511 when attempting to evaluate the above expression. The LOG function can be replaced with LOG10 and both Excel and OpenOffice will work.
Wayne Kirkwood - 2008-28-6 09:16:00 PDT


















