Software for calculating best resistors. - Page 1
Forum section: electronics / general

author: mendip_discovery
author_rank: Super Contributor
timestamp: May 27, 2024, 10:55:22 am
content: If I wanted to connect resistors in series and in parallel to get myself the closest to nominal value resistor, has anyone come across software to calculate this from a collection of resistors.If it doesn't exist my thoughts are to take a spreadsheet of resistors and ask a program to calculate all the options that fit my layout, eg four resistors, two in series in parallel with another two in series.

author: Zero999
author_rank: Super Contributor
timestamp: May 27, 2024, 11:02:22 am
content: https://www.qsl.net/in3otd/parallr.htmlhttps://jansson.us/resistors.htmlhttps://www.random-science-tools.com/electronics/divider.htmhttp://earmark.net/gesr/opamp/

author: Gyro
author_rank: Super Contributor
timestamp: May 27, 2024, 11:16:06 am
content: Not forgetting the home grown rfun...https://www.eevblog.com/forum/projects/fun-with-resistors/Edit: Doh, the link doesn't work, maybe somebody has a copy

author: mendip_discovery
author_rank: Super Contributor
timestamp: May 27, 2024, 11:27:14 am
content: Quote from: Zero999 on May 27, 2024, 11:02:22 amyup, they are handy calculators but fail at accepting a list of measured resistors I have in my collection.Imagine I had a selection of 10 resistors, the number of iterations I have would take some time to work out the best solution. I would like to automate it.

author: Zero999
author_rank: Super Contributor
timestamp: May 27, 2024, 12:01:31 pm
content: I think I've seen something like that, but didn't bother bookmarking it, because I just stock the entire E24 series from 10R to 1M and E12 from 1R to 10M, so it's no use to me.I had a quick search and found this, which appears to have the ability to select the values used in the search.http://jahonen.kapsi.fi/Electronics/ResOptimizer/

author: brucehoult
author_rank: Super Contributor
timestamp: May 27, 2024, 12:05:21 pm
content: Quote from: Gyro on May 27, 2024, 11:16:06 amThe link works for me. But there was also a much more recent discussion.https://www.eevblog.com/forum/projects/resistor-equivalence-finder-using-jlc-basic-resistors-only/The resistor set is configurable....

author: Gyro
author_rank: Super Contributor
timestamp: May 27, 2024, 12:31:37 pm
content: I meant the link to the github repository (404 not found), not the thread (which obviously does work).I do have a zip copy of rfun.exe and associated chm help file V0.25 which I can upload if necessary (and appropriate?). V0.25 introduced User sets of resistors.

author: brucehoult
author_rank: Super Contributor
timestamp: May 27, 2024, 08:58:38 pm
content: Oh I see,The entire 'theageman' git is gone. Maybe he is too. He posted here only in August and September 2015, though there was apparently a login in 2022.

author: Gyro
author_rank: Super Contributor
timestamp: May 27, 2024, 09:13:01 pm
content: Yes, he's been gone a long while. I often wonder (worry) about what has happened in such circumstances. One moment he was discussing previews of V0.26 and then nothing -the last repository snapshot on Archive.org was 2020. There is a pdf of the help file on page 3 of the thread which gives a good picture of the s/w functionality.

author: notsob
author_rank: Frequent Contributor
timestamp: May 27, 2024, 09:18:25 pm
content: Try downloading "ELECTRODOC" to your phone

author: abeyer
author_rank: Frequent Contributor
timestamp: May 28, 2024, 12:02:08 am
content: Quote from: brucehoult on May 27, 2024, 08:58:38 pmhttps://web.archive.org/web/20201122005250/https://codeload.github.com/theageman/rfun/tar.gz/0.25

author: thermistor-guy
author_rank: Frequent Contributor
timestamp: May 28, 2024, 12:06:13 am
content: Quote from: mendip_discovery on May 27, 2024, 10:55:22 amA brute-force approach like this would work, in many practical cases.My preference would be to code a solution using Octave (https://www.octave.org/).

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 28, 2024, 01:24:02 am
content: This one is handy for selecting resistor values for resistive dividers:https://damien.douxchamps.net/elec/resdiv/

author: kripton2035
author_rank: Super Contributor
timestamp: May 28, 2024, 06:23:27 am
content: it would be a good programming exercice with your favorite programming tool...and if you don't do any programming, then it would be a good excuse to start learning some !

author: jonpaul
author_rank: Super Contributor
timestamp: May 28, 2024, 06:25:14 am
content: experiemce, RLC/DVM, box of parts

author: ledtester
author_rank: Super Contributor
timestamp: May 28, 2024, 07:12:25 am
content: Quote from: thermistor-guy on May 28, 2024, 12:06:13 amA quick feasibility analysis...For 4 resistors there are 10 distinct topologies to consider:- R+R+R+R- R+R+(R|R)- R+(R|R|R)- R+(R|(R+R))- (R|R)+(R|R)and the ones obtained by interchanging + and |.Let's say you restrict yourself to 5 decades of the E12 series - so each R has 60 possible values.So you would have to evaluate 60^4*10 ~ 130 million different configurations which is very doable.

author: golden_labels
author_rank: Super Contributor
timestamp: May 28, 2024, 11:49:35 am
content: KiCad has that built in: in “Calculator Tools”, under “Resistor Calculator”.Don’t get lost in calculating perfect ratios, when it serves no purpose. Sometimes it does, but mind you’re still dealing with tolerances. On both ends. The solution found is merely the nominal value. A circuit shouldn’t depend on being fine-tuned, if that can be avoided. Together that means one may just use the nearest R24 value. Not always, but usually. And even then a potentiometer in parallel/series may be a better idea for tuning.Spreadsheets may be useful too. Not for simple calculation, but for producing visual aids. If you know the range of resistances you want to use,(1)you can calculate all possible solutions, their relative difference to the target, and use conditional formatting to highlight all ok-ish ones. This way you can quickly look up what matches your needs or stock. And, even if calculated for E24, gives valid results for other series — the underlying solutions space is continuous.(1)If you can’t limit yourself to one or two orders of magnitude, a spreadsheet will not do. A programming language is going to be better, though a similar concept may be used.

author: bpiphany
author_rank: Regular Contributor
timestamp: May 28, 2024, 12:08:50 pm
content: Quote from: ledtester on May 28, 2024, 07:12:25 amI envision it should be possible to limit the number of values necessary to combine. If they are more than two decades apart you're probably doing something wrong.

author: Gyro
author_rank: Super Contributor
timestamp: May 28, 2024, 01:03:11 pm
content: Quote from: Gyro on May 27, 2024, 09:13:01 pmAs archive.org keeps throwing 503 (no server available to handle your request) errors, I've attached my copy of rfun V0.25 zip that I downloaded in 2017, as I mentioned previously. It just contains the standalone exe and the chm help file (which you can lose if worried about chm file security). The archive.org snapshot also contains the sources.If you trust me then go ahead and use it (scan it anyway). I will delete it if theageman contacts me, but as it's the same as the one on archive.org (if you persevere) I can't see a problem, lots of members back then downloaded it anyway. Otherwise, please just ignore.

author: abeyer
author_rank: Frequent Contributor
timestamp: May 28, 2024, 08:46:10 pm
content: Quote from: Gyro on May 28, 2024, 01:03:11 pmYeah, maybedon'ttry right now, as they're in the midst of a DDoS attack, so would make sense to hold off until that's resolved.

author: Smokey
author_rank: Super Contributor
timestamp: May 29, 2024, 03:23:16 am
content: I wrote a python script back in the day to do this. Took my list of resistor values and did all the combination. I would then sort them by % deviation from optimal value. Worked great. I have no idea where that script is now thoughI bet chatGPT could write that first go.

author: exmadscientist
author_rank: Frequent Contributor
timestamp: May 29, 2024, 07:11:49 am
content: This one is pretty nice for working with lots of constraints:http://calc.kirill-kryukov.com/electronics/resistor-network-finder/Clever use of the stock entry boxes can get you to lots of fun places.

author: bpiphany
author_rank: Regular Contributor
timestamp: May 29, 2024, 10:25:39 am
content: Quote from: exmadscientist on May 29, 2024, 07:11:49 amThat's very useful. I bought reels of resistors in E3 series, to never need to do it again.. For prototyping it's easy enough to stack two or three on an SMD footprint. But finding the best combination can bog you down in the combinatorics =p

author: Infraviolet
author_rank: Super Contributor
timestamp: May 30, 2024, 01:19:08 am
content: Not for this exactly, but I've done brute-force calculators in R/RStudio for more specific situations, like the three resistors needed for a comparator with hysteresis.I'd give another vote towards writing your own with an input array where you can type in a list of the series of resistors E-x or whichever, or an E series plus some extra particular values you have around, and have it try combinations to find the closest to the desired resistance.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 30, 2024, 12:10:15 pm
content: Perfect use case for a static HTML+JavaScript tool page (no network connection required), since everyone and everything tends to have a browser nowadays.For the input set of resistors, a simple regular expression matcher can parse typical formats (2R2, 2.2k) and even support precision definition, so that range arithmetic can provide an estimate on the result precision. (Two cases per resistor, for each resistor.)As usual, the problem is the interface; here, to limit the topology you're interested in.One option would be to let the user specify the expression using ( ) + | and R1, R2, R3, ... as needed, with all combinations of the named resistors picked from the set of values, and the few combinations closest to the desired value shown. Two in parallel and two pairs in series would be(R1|R2)+(R3|R4).If you haveNdifferent resistances andKdifferent resistors in the expression, it'd checkNKorN!/(N-K)! =N(N-1)(N-2)⋯(N-K+2)(N-K+1) combinations, depending on whether one wants all combinations or only unique tuples.

author: kripton2035
author_rank: Super Contributor
timestamp: May 30, 2024, 12:36:46 pm
content: I want to have a 117 ohm resistor using standard E12 values and combining max 4 resistors in serie or parallel.ChatGPT (hallucinating mode ?)Quote

author: mariush
author_rank: Super Contributor
timestamp: May 30, 2024, 12:51:29 pm
content: 142 in parallel with 680 gives you 117.4 ohm 142 can be made with 120 + 22 ohm in series3300 || 270 || 220 gives you 116.92 ohmchatGPT doesn't surprise me....

author: kripton2035
author_rank: Super Contributor
timestamp: May 30, 2024, 02:56:29 pm
content: yes it is VERY BAD at anything calculated...

author: Tation
author_rank: Regular Contributor
timestamp: May 30, 2024, 04:56:25 pm
content: Quote from: kripton2035 on May 30, 2024, 02:56:29 pmIMHO, uses to be syntactically correct, semantically absurd.

author: bpiphany
author_rank: Regular Contributor
timestamp: May 31, 2024, 07:08:50 am
content: Actually 56+33+18+10=117 inseries. Perhaps a coincidence on the hallucinogens.Edit: and according to the nifty calculator aboveCode:TargetApproximationNetworkErrorError ≤ 0.1?117~117.012120 || 4.7k0.011%✓

author: Zero999
author_rank: Super Contributor
timestamp: June 01, 2024, 12:51:58 pm
content: 1% tolerance resistors can be found in E24 values. There's normally no point in aiming for much less than 0.2% or so, because the resistor tolerance will dominate. Fortunately that should be possible to make a potential divider with three resistors to get a ratio to that tolerance for most ratios, especially the smaller ones.Awhile ago I made myself some tables with different combinations of E6, E12 and E24 values to make E24 and E96 values. I don't use them much nowadays because there are better online calculators.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 01, 2024, 10:22:02 pm
content: For those interested in understanding how the E-series are built instead of just blindly using tables of values:https://en.wikipedia.org/wiki/E_series_of_preferred_numbers

author: golden_labels
author_rank: Super Contributor
timestamp: June 04, 2024, 07:12:58 am
content: Xvrpublished a divider solver.It only models a voltage divider, so not exactly the same tool. But certainly worth looking at. An amazing, comprehensive tool.Instructions for solving a subset of problems from this thread. For all configurations unset Voutand also unset its target status.2 resistor in series:Set Rinas target, in “Restricted” tab set the desired value and allowed margins. Run solver.2 resistor in parallel:Set Routas target, in “Restricted” tab set the desired value and allowed margins. Run solver.

author: Tation
author_rank: Regular Contributor
timestamp: June 04, 2024, 02:29:50 pm
content: I'm feeling than that all these calculators do have a little flaw: they do not take into account the tolerance.I mean, as stated before, E12 value 12 can be achieved as a series of E3 values 10 + 2.2. But E12 values have a tolerance of 10 %, so we want to be inside 12 ± 10 % ⇒ between 10.8 and 13.2. In order for a series of two resistors of 10 and 2.2 to be inside such margin, they must have a tolerance of 5 %, otherwise there is a possibility of their series being outside such interval.In doing these calculations I'm considering/assuming that:(assumption) The resistance of resistors is distributed normally (Gaussian) with mean equal to the nominal value of the resistor and standard deviation proportional to the product of nominal value times toleranceThus, conductance of a given resistor, provided that the tolerance is small, is also distributed normally with mean the inverse of the resistor nominal value and equal tolerance than the resistance(assumption) The true resistance values of two resistors are uncorrelatedThus, the resistance of a series of two resistors distributes normally with mean the sum of both resistors nominal values and \(\sigma=\sqrt{\sigma_1^2 + \sigma_2^2}\)Thus, the series of two resistors of equal tolerance \(T_0\) has tolerance \(T=T_0{\sqrt{R_1^2+R_2^2}\over R_1+R_2}\)The «tolerance» in resistance of a parallel combination of two resistors of tolerance \(T_0\) has exactly the same expression as the series caseIt is interesting to note that the tolerance of a series/parallel combination of two resistors has atightertolerance than the original resistors. In spite of this, there are cases (the 12 ≈ 10 + 2.2 above) when we need resistors of tighter tolerance than that of the target E series. In this example case, if using 10 % resistors, the nominal value of the series is 12.2, and its tolerance 8.4 %, so can expect values between 11.26~13.22, outside by a little of the desired 10.8~13.2. If the resistors are 5 %, the final range would be 11.71~12.71 ⇒ OK.Maybe I'm a bit picky here, but had a fun time this morning doing these calculations

author: mariush
author_rank: Super Contributor
timestamp: June 04, 2024, 09:37:29 pm
content: Quote from: Tation on June 04, 2024, 02:29:50 pmI don't agree with this... in these days, the manufacturing process of resistors is good enough and the resistors are cheap enough that you would probably have a hard time getting even higher than 5% tolerance.They most likely bin the resistors automatically and reserve the <1% for the 1% tolerance, <3-4% for the 5% bucket and on 10% you'd probably get anything higher than 3-4% or you'd just get the ones binned for <5%.Sure, account tolerance, but aim for under 5% at most ... nowadays I just default on 1% resistors because they're cheap enough.

author: Tation
author_rank: Regular Contributor
timestamp: June 05, 2024, 09:36:03 am
content: I've found that with only 2 resistors from the E12 series, sometimes in series, others in parallel, one can reach (under the assumptions above):all E24 values with 5% tolerance if the E12 resistors are 5%all E24 values with 2% tolerance if the E12 resistors are 2%all E24 values with 0.2% tolerance if the E12 resistors are 0.1%all E48 values with 2% tolerance if the E12 resistors are 1%all E48 values with 1% tolerance if the E12 resistors are 0.5%all E96 values with 1% tolerance if the E12 resistors are 0.1%almost all E192 values (but nine: 1.13, 1.37, 1.91, 2.05, 2.37, 2.43, 4.42, 6.34, 9.31) with 0.5% tolerance if the E12 resistors are 0.1%almost all E192 values (but one: 9.31) with 0.5% tolerance if the E12 resistors are 0.01%

author: mike449
author_rank: Contributor
timestamp: June 05, 2024, 08:03:19 pm
content: I use this one:https://www.qsl.net/in3otd/parallr.html

author: snarkysparky
author_rank: Frequent Contributor
timestamp: June 22, 2024, 05:58:13 pm
content: simple parallel pair finder for OctaveCode:% parallel resistor finder. Finds the closes pair of resistors% in the inventory to approximate a desired resistor value% all the resistors in your kit.. spaces between values. ... for line continuervals = [100 200 470 590 1000 2000 3000 3900 4700 4900 ...4990 10000 22000 3900 15000];rtarget = 8700; % needed resistance[rw cl] = size(rvals); % get how many resistors in stockH = ones(1,cl);H = rvals' * H; % matrix of resistor values with equal rowsV = H'; % matrix of resistor values with equal columnsParVals = rvals' * rvals; %product of all resistor values. Rx*RyParvals = ParVals ./ ( H + V); % parallel valuesDiff = abs(rtarget - Parvals); % abs value of error between each entry and targeterror = min(min(Diff)); % smalles absolute valueggg = tril(Diff == error); % set to 1 all matching locations in lower triangular matrix[rw cl] = find(ggg); % get the indices of the two resistorsR1 = rvals(cl) % show first resistorR2 = rvals(rw) % show second resistorResult = R1*R2/(R1+R2) % calculate resulting parallel combinationErrPercent = abs((Result - rtarget)/rtarget)*100 % percent error

author: mendip_discovery
author_rank: Super Contributor
timestamp: July 03, 2024, 08:27:36 pm
content: Woops I forgot about this for a bit.What I was hoping to do was measure a selection of resistors, let us say 10k and from the ones that are a little under and a little over etc work out the best to use to produce the closest to absolute 10k you can. The plan is to make a few DIY standard resistors that use 2 resistors in series, parallel to another 2 resistors in series.But its nice it started up the conversation again.

author: mendip_discovery
author_rank: Super Contributor
timestamp: July 15, 2024, 05:17:58 pm
content: Just saw this on the Metrology section posted by@ch_scrhttps://www.eevblog.com/forum/metrology/precise-measurement-of-high-value-resistors/msg5573563/#msg5573563Quote from: ch_scr on July 15, 2024, 08:54:27 amI have attached it below just to save people hunting it.