Resistor Equivalence Finder using JLC Basic Resistors Only - Page 1
Forum section: electronics / projects

author: sleemanj
author_rank: Super Contributor
timestamp: June 24, 2022, 08:48:36 am
content: If you use JLC PCB's Assembly service you will know that they have a selection of resistors in the "Basic" parts, that is resistors that are always loaded in their pick-n-place and accordingly are typically some fraction of a cent more expensive than free even if you only need a couple boards assembled.But the selection isn't even the full E24 set (in fact for 1206 there are a whole 18 values available!) and you might need something it doesn't have.I spent the last couple days improving my existing tool for finding resistor networks from limited stock and it now has presets for (at time of writing) JLC's basic resistor sets in 0402, 0603, 0805 and 1206. Including click-to-copy JLC/LCSC part numbers.Picture shows the usage:Here is the link:https://sparks.gogo.co.nz/resistor_paralleler.html

author: planet12
author_rank: Regular Contributor
timestamp: February 14, 2024, 10:15:22 pm
content: A quick note to say "thanks!" - finding what you want in the "basic parts" selection is tough, in part because half the time the value is not even shown in the parts list.This made it a breeze - finding both exact values I needed and easy series/parallel combinations (why yes, I could just squeeze another 0603 in there).

author: brucehoult
author_rank: Super Contributor
timestamp: February 14, 2024, 11:26:13 pm
content: Why would you prefer parallel over series?

author: sleemanj
author_rank: Super Contributor
timestamp: February 16, 2024, 09:19:12 am
content: I find parallel is more flexible, you can take one out, or add another in, without changing the circuit design even if it means stacking one SMD resistor right on top of another on a prototype. It's also easier to pack them into a small space on a PCB (especially when etching yourself) than with series.The tool was made primarily for people like me who do not keep full sets of resistors for their prototyping supply just certain values, so instead of changing the circuit to get a designed value that I don't have, I can just get a parallel set and stack them up.

author: donlisms
author_rank: Frequent Contributor
timestamp: February 16, 2024, 06:37:29 pm
content: I'm no mathematician, but it seems like adding resistor values in series gives fewer options than the more ratio-like results of paralleling.Eg I could (1k || 1M) or (1k || 2M) for an adjustment of 0.5 ohms. Not that you'd ever do that, but my intuition suggests to me that using various ratios gives you more options - two mids versus a high and a low, that kind of thing.

author: MarkT
author_rank: Frequent Contributor
timestamp: February 17, 2024, 10:59:10 am
content: Quote from: donlisms on February 16, 2024, 06:37:29 pmIf you replace resistance with conductance you can swap parallel with series(*) and see there is no inherent difference in the flexibility of value selection between parallel and series. And given E12 etc are approximately exponentially spaced their should be no difference in practice.(*) the formula for parallel conductance is the same as series resistance,the formula for series conductance is the same as parallel resistance...

author: Vovk_Z
author_rank: Super Contributor
timestamp: February 18, 2024, 08:34:52 pm
content: Yes, that's the same in formula, but quite different in life 😀. I use parallel resistors much more often too.

author: brucehoult
author_rank: Super Contributor
timestamp: February 19, 2024, 12:04:06 am
content: It doesn't seem to consider (r1 || (r2 + r3)), or at least I couldn't make it generate such a suggestion even when I fed it a deliberately constructed value e.g. 228.10345 = (270 || (1k + 470))Of course given component tolerances it's pointless to insist on a theoretical exact match.

author: sleemanj
author_rank: Super Contributor
timestamp: February 19, 2024, 12:13:48 am
content: It's not exhaustive, or it would be there forever. Patches welcome for better search algorithms. View Source for the Javascript.Also it only goes to the milliohm, if you set exact matches it will find for you 228.103 Ω [ 220 kΩ || 4.7 kΩ || 240 Ω ] :-)

author: brucehoult
author_rank: Super Contributor
timestamp: February 19, 2024, 03:14:07 am
content: Quote from: sleemanj on February 19, 2024, 12:13:48 amNot forever, at least for 3 resistors. Brute force of all combinations of three resistors from six decades of E24 is just under 3 million combinations. Just over 3 million if you add 0 and ∞ as options. Multiply that by the four possible configurations "a + b + c", "a + (b || c)", "a || (b + c)", "a || b || c" and you've got 12 million. That's fraction of a second on modern JIT'd JavaScript.Sure, it will start to add up at 4 resistors, but I don't think there's any point unless the component tolerance is amazing. Even just 3 resistors in series is guaranteed to get you theoretically to within 0.1% of the desired value -- the first resistor gets you to within 10%-12.5%, and each additional one cuts the error by a factor of 8-10, plus the last resistor can tweak for just above or just below the desired value.That doesn't even require a search.e.g. my 228.10345 exampleR1: 220, total 220, error -8.10345, -3.55%R2: 7.5, total 227.5, error -0.60345, -0.26%R3: 0.62, total 228.12, error -0.01655, +0.007%This might not be practical, for example because you can't actually get a 0.62 ohm resistor. But if you can then one practical aspect of this construction is that only R1 has to have super high precision. e.g. R1 0.1%, R2 1%, R3 10% would not be noticeably worse than all three being 0.1%.Doing an exhaustive search can of course only improve the results.Or, you could do an all-parallel construction in the same way:R1: 240, total 240, error +11.89655, +4.96%R2: 4k7, total 228.34, error +0.23663, +0.104%R3: 220k, total 228.10333, error -0.00012, -0.00005%That's worked out much more accurate. I don't know that's always going to be the case, or just what happened in this example.And, again, that's not a search. It's merely using each added resistor to correct the error in the total of the previous resistors. It's a direct calculation I did with a handheld 4 function calculator.

author: brucehoult
author_rank: Super Contributor
timestamp: February 19, 2024, 03:18:20 am
content: btw, I once knew an Andrew Sleeman, I think at Waikato University in the early 80s. Any relation?

author: sleemanj
author_rank: Super Contributor
timestamp: February 19, 2024, 06:24:47 am
content: Remember this calculator is for people with arbitrary incomplete sets of resistors in stock.Anyway, as I say, patches welcome. In fact, all you have to do is implement this, you can test it in the javascript console, just paste your new function there and it will be used for future searches.Code:function custom_search_algorithm(Milliohms,MaximumErrorMilliohms,PreferLessResistorsWhenErrorLessThanMilliohms,MaximumNumberOfResistors){if(0) // Dummy example code{// You can get an array of all the resistors the user has specified that// they have available using this function, they are 3 decimal place strings// in ohms.var AllTheResistors = all_resistors(); // eg [ "1.000", "2.700", "1200.000" ]// Imagining a request for, say 1900 millohms, and it findes these// possible combinations for 1800, 2000 and 2200...var Candidates = [ ];Candidates = [ ["1.000"], ["1.600", "1.600"] ] // 1r + (1.6r || 1.6r);Candidates = [ ["1.000"], ["1.000"] ]; // 1r + 1rCandidates = [ ["2.200" ] ]; // 2.2rreturn Candidates;}return false; // use default algorithm}Quote from: brucehoult on February 19, 2024, 03:18:20 amNot that I know of no.

author: brucehoult
author_rank: Super Contributor
timestamp: February 19, 2024, 07:50:30 am
content: Quote from: sleemanj on February 19, 2024, 06:24:47 amYes, I'm aware. I'm not assuming anything about the available set of values, just at each step finding the available value that undershoots (series) or overshoots (parallel) the desired value by the smallest amount. A full search will almost always produce a better result, and as I said, brute force is entirely reasonable for three resistors in Javascript on a modern computer. But you can get a pretty decent result by hand too.

author: Swainster
author_rank: Frequent Contributor
timestamp: February 19, 2024, 09:54:28 am
content: Slightly at a tangent, but closely related, is that in my experience the JLC component search is not very reliable, especially for picking 'basic' components. It's worth working out the expected part number of the 'basic' part and directly putting it in your parts list form - sometimes it turns out that the component is both available and classified as 'basic', but for some reason just not picked up by the search dialog. This often works for me for 'missing' 0402 or 0603 resistors, but maybe not so useful for less common sizes like 1206

author: sleemanj
author_rank: Super Contributor
timestamp: February 20, 2024, 12:58:18 am
content: Quote from: Swainster on February 19, 2024, 09:54:28 amUse this instead:https://yaqwsx.github.io/jlcparts/It's a bit heavy on your browser and will take some time to do the first components update (which it saves in your browser local storage for future), but once done it is much superior to looking for stuff at JLC itself.

author: shapirus
author_rank: Super Contributor
timestamp: May 28, 2024, 08:31:50 am
content: This is a great tool.Have you considered opensourcing it (and saving in a repo on github or elsewhere)?The reason why I'm asking this is thata lotof similarly great projects hosted on isolated servers around the world went dead over time when their authors lost interest, stopped paying for the hosting or for other reasons. And that's a shame, good tools like this one must be preserved.p.s. It looks like it's all implemented in client-side javascript, so it is technically open source already (but that doesn't imply a particular license). Still, saving it in a git repo would at least serve as a backup copy.