EDN logo


Design Ideas: August 3, 1995

Resistance calculator yields precise values

David Kirkby,
Department of Medical Physics, University College London, London, UK.


For times when the nearest preferred resistor value isn't close enough to the desired value, a program comes in handy. (You'll find the executable ZIPfile and several source-code files for the program in EDN BBS /DI_SIG #1740.) The program finds all combinations of two series or parallel connected resistors, within a specified tolerance of the required value, using only preferred values from the E6, E12, E24, and E96 ranges (6, 12, 24, and 96 different values per decade).

The program, which is written in C and runs on the PC, has four arrays that contain the preferred values of each range. The two smallest arrays are listed below.

double e6[6] = 1.0, 1.5, 2.2, 3.3, 4.7, 6.8;

double e12[12] = 1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2;

The program has a simple main loop that requests the following information from the user: the value of the resistor required (such as 1234 Ohms); the range (for example, E24); the minimum (such as 10 Ohms) and maximum (for example, 2.2 MOhms) resistor available in the range; whether you plan a series (S), parallel (P), or both (B) connection; and, finally, the accuracy required (for example, 0.5%). The program then lists all combinations that meet or exceed the accuracy requirement.

For these given example values, the best series combination would be 33 and 1200 Ohms, giving 1233 Ohms. However, a better combination is 1.3 kOhms in parallel with 24 kOhms, giving 1233.2 Ohms.

The program requires ANSI.SYS or equivalent installed on the PC for screen control. Although the program was written for resistors, you can also use it for inductors and capacitors. For capacitors, you need to transpose the meaning of series and parallel.





| EDN Access | feedback | subscribe to EDN! |
| design features | design ideas | columnist |


Copyright © 1995 EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.