Author Topic: Resistor Equivalence Finder using JLC Basic Resistors Only  (Read 22803 times)

0 Members and 1 Guest are viewing this topic.

Offline sleemanjTopic starter

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Resistor Equivalence Finder using JLC Basic Resistors Only
« on: June 24, 2022, 08:48:36 am »
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
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 
The following users thanked this post: planet12, brabus, evb149, MegaVolt, shapirus, watchmaker

Offline planet12

  • Regular Contributor
  • *
  • Posts: 83
  • Country: nz
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #1 on: February 14, 2024, 10:15:22 pm »
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).
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4343
  • Country: nz
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #2 on: February 14, 2024, 11:26:13 pm »
Why would you prefer parallel over series?
 

Offline sleemanjTopic starter

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #3 on: February 16, 2024, 09:19:12 am »
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. 


~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline donlisms

  • Frequent Contributor
  • **
  • Posts: 294
  • Country: us
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #4 on: February 16, 2024, 06:37:29 pm »
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. 
 

Offline MarkT

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: gb
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #5 on: February 17, 2024, 10:59:10 am »
I'm no mathematician, but it seems like adding resistor values in series gives fewer options than the more ratio-like results of paralleling.
If 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...
 

Offline Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1454
  • Country: ua
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #6 on: February 18, 2024, 08:34:52 pm »
Yes, that's the same in formula, but quite different in life  😀. I use parallel resistors much more often too.
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4343
  • Country: nz
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #7 on: February 19, 2024, 12:04:06 am »
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.
 

Offline sleemanjTopic starter

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #8 on: February 19, 2024, 12:13:48 am »
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 Ω ] :-)
« Last Edit: February 19, 2024, 12:15:54 am by sleemanj »
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4343
  • Country: nz
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #9 on: February 19, 2024, 03:14:07 am »
It's not exhaustive, or it would be there forever.  Patches welcome for better search algorithms.  View Source for the Javascript.

Not 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 example

R1: 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.

 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4343
  • Country: nz
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #10 on: February 19, 2024, 03:18:20 am »
btw, I once knew an Andrew Sleeman, I think at Waikato University in the early 80s. Any relation?
 

Offline sleemanjTopic starter

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #11 on: February 19, 2024, 06:24:47 am »
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: [Select]
          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[1800] = [  ["1.000"], ["1.600", "1.600"] ] // 1r + (1.6r || 1.6r);
              Candidates[2000] = [  ["1.000"], ["1.000"] ];            // 1r + 1r
              Candidates[2200] = [  ["2.200" ] ];                          // 2.2r
              return Candidates;
            }
           
            return false; // use default algorithm
          }

btw, I once knew an Andrew Sleeman, I think at Waikato University in the early 80s. Any relation?

Not that I know of no.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4343
  • Country: nz
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #12 on: February 19, 2024, 07:50:30 am »
Remember this calculator is for people with arbitrary incomplete sets of resistors in stock.

Yes, 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.
 

Offline Swainster

  • Frequent Contributor
  • **
  • Posts: 260
  • Country: sg
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #13 on: February 19, 2024, 09:54:28 am »
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
 

Offline sleemanjTopic starter

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #14 on: February 20, 2024, 12:58:18 am »
JLC component search is not very reliable,

Use 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.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 
The following users thanked this post: Swainster, Kim Christensen

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1617
  • Country: ua
Re: Resistor Equivalence Finder using JLC Basic Resistors Only
« Reply #15 on: May 28, 2024, 08:31:50 am »
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 that a lot of 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf