calculator for resistive divider using standard resistor values?

Discussion in 'Electronic Design' started by M. Noone, Dec 23, 2005.

  1. M. Noone

    M. Noone Guest

    Hi - I feel like I saw this somewhere but have since lost the link. It
    was a website where you could put in the ratio you want a resistive
    voltage divider to give, and it would give you combinations of standard
    resistor values that would yield that ratio.

    Anybody know of anything like this?

    Or are there any tricks to finding these values that I'm just not aware
    of?

    Thanks,

    -M. Noone
     
    M. Noone, Dec 23, 2005
    #1
    1. Advertising

  2. M. Noone

    Ken Taylor Guest

    "M. Noone" <> wrote in message
    news:...
    > Hi - I feel like I saw this somewhere but have since lost the link. It
    > was a website where you could put in the ratio you want a resistive
    > voltage divider to give, and it would give you combinations of standard
    > resistor values that would yield that ratio.
    >
    > Anybody know of anything like this?
    >
    > Or are there any tricks to finding these values that I'm just not aware
    > of?
    >
    > Thanks,
    >
    > -M. Noone
    >

    Google. I actually used Altavista and used +resistor +combination
    +calculator and got hits. I'm sure it would work for you too.

    Cheers.

    Ken
     
    Ken Taylor, Dec 23, 2005
    #2
    1. Advertising

  3. M. Noone

    Ken Moffett Guest

    Ken Moffett, Dec 23, 2005
    #3
  4. M. Noone

    Joerg Guest

    Joerg, Dec 23, 2005
    #4
  5. M. Noone

    M. Noone Guest

    Perfect - google turned up a different page than that one on the same
    website, but with different keywords. I think I used something like
    'resitor divider common value calculator'. Thanks!

    Ken Moffett wrote:
    > "Ken Taylor" <> wrote in news:DiZqf.10243$vH5.499299
    > @news.xtra.co.nz:
    >
    > > +resistor +combination
    > > +calculator

    >
    > http://www.play-hookey.com/dc_theory/resistor_ratios.html
     
    M. Noone, Dec 23, 2005
    #5
  6. On Fri, 23 Dec 2005 12:37:52 -0800, M. Noone wrote:

    > Hi - I feel like I saw this somewhere but have since lost the link. It
    > was a website where you could put in the ratio you want a resistive
    > voltage divider to give, and it would give you combinations of standard
    > resistor values that would yield that ratio.
    >
    > Anybody know of anything like this?
    >
    > Or are there any tricks to finding these values that I'm just not aware
    > of?
    >
    > Thanks,
    >
    > -M. Noone



    Spreadsheet.

    Cheers!
    Rich
     
    Rich Grise, but drunk, Dec 24, 2005
    #6
  7. M. Noone

    Ken Taylor Guest

    Ken Taylor, Dec 24, 2005
    #7
  8. "M. Noone" <> writes:

    > Hi - I feel like I saw this somewhere but have since lost the link. It
    > was a website where you could put in the ratio you want a resistive
    > voltage divider to give, and it would give you combinations of standard
    > resistor values that would yield that ratio.
    >
    > Anybody know of anything like this?
    >
    > Or are there any tricks to finding these values that I'm just not aware
    > of?
    >
    > Thanks,
    >
    > -M. Noone
    >



    I once knocked up a C program that you are welcome to try, or perhaps
    expand on.

    It has a very lazy algorithm that searches all combinations of 2 and 3
    resistor dividers to find the closest match. You can customise the
    first line of main() to choose between e6, e12 or your own resistor
    value series. There are still plenty of configurations it does not
    try, such as three resistors in series. Also you have to get the
    correct power of 10 by yourself!


    John

    ===============================================================


    #include "stdio.h"
    #include "math.h"

    /* The E12 series */

    float e12_base[]= { 1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2 };
    float e6_base[] = { 1.0, 1.5, 2.2, 3.3, 4.7, 6.8};
    float my_base[] = { 1.0, 1.5, 1.8, 2.2, 4.7, 6.8};


    /* program to find the optimum series-parallel combination of
    resistors, to get a given ratio */


    float xyz1(float x, float y, float z)
    {
    return x/(1.0/(1.0/y+1.0/z));
    }

    float xyz2(float x, float y, float z)
    {
    return x/(y+z);
    }

    int main(void)
    {
    /* customise these three (6 or 12) */
    float * base_series=e12_base;
    int base_N=12;

    int decades=6;

    float target;

    int N=base_N*decades;

    int x,y,z;
    float min_error=1E30;
    float error;

    float ratio;

    int x_min, y_min, z_min;

    float series[N];

    int i;
    float decade=1;
    int n=0;
    for(i=0;i<decades;i++)
    {
    for(x=0;x<base_N;x++)
    {
    series[n] = base_series[x]*decade;
    printf("%f ",series[n]);
    n++;
    }
    printf("\n");
    decade *= 10;
    }

    printf("Resistor series-parallel calculator program!\n");
    printf("Calculates optimum combinations of resistors\n");
    printf("to acheive a target ratio of resistance R1/R2\n");
    printf("\n\n\nEnter target ratio (1.000-9.999):");

    scanf("%f", &target);
    printf("Target ratio is %f\n\n", target);

    /* algorithm: two-resistor divider (Rx, Ry): for each Rx, Ry in
    series, find minimum ratio Rx/Ry.

    */

    for(x=0;x<N;x++)
    {
    for(y=0;y<N;y++)
    {
    ratio = series[x]/series[y];
    error = fabs(ratio-target);
    if(error<min_error)
    {
    min_error=error;
    x_min=x;
    y_min=y;
    }
    }
    }

    ratio=series[x_min]/series[y_min];
    printf("\n\nBest ratio with two resistors is %f\n",ratio);
    printf("Percentage error is %f%%\n",100*(1-target/ratio));
    printf("Ry=%f\n", series[y_min]);
    printf("Rx=%f\n", series[x_min]);

    min_error=1E30;


    /* algorithm: three-resistor divider (Rx, (Ry||Rz)) */
    for(x=0;x<N;x++)
    {
    for(y=0;y<N;y++)
    {
    for(z=0;z<N;z++)
    {

    ratio = xyz1(series[x],series[y],series[z]);
    error = fabs(ratio-target);
    if(error<min_error)
    {
    min_error=error;
    x_min=x;
    y_min=y;
    z_min=z;
    }
    }

    }
    }

    ratio = xyz1(series[x_min],series[y_min],series[z_min]);

    printf("\n\nBest ratio with 3 resistors (Rx, (Ry||Rz) is %f\n",ratio);
    printf("Percentage error is %f%%\n",100*(1-target/ratio));
    printf("Rz=%f\n", series[z_min]);
    printf("Ry=%f\n", series[y_min]);
    printf("Rx=%f\n", series[x_min]);


    /* algorithm: three-resistor divider (Rx, (Ry+Rz)) */
    min_error=1E30;
    for(x=0;x<N;x++)
    {
    for(y=0;y<N;y++)
    {
    for(z=0;z<N;z++)
    {
    ratio = xyz2(series[x],series[y],series[z]);
    error = fabs(ratio-target);
    if(error<min_error)
    {
    min_error=error;
    x_min=x;
    y_min=y;
    z_min=z;
    }
    }

    }
    }

    ratio = xyz2(series[x_min],series[y_min],series[z_min]);

    printf("\n\nBest ratio with 3 resistors (Rx, (Ry+Rz) is %f\n",ratio);
    printf("Percentage error is %f%%\n",100*(1-target/ratio));
    printf("Rz=%f\n", series[z_min]);
    printf("Ry=%f\n", series[y_min]);
    printf("Rx=%f\n", series[x_min]);


    return 0;
    }





    --

    John Devereux
     
    John Devereux, Dec 24, 2005
    #8
  9. M. Noone

    Fred Bloggs Guest


    > Also you have to get the
    > correct power of 10 by yourself!


    Oh well- forget it then!- waaaaa...ay too much thinking required....
     
    Fred Bloggs, Dec 24, 2005
    #9
  10. Fred Bloggs <> writes:

    > > Also you have to get the
    >> correct power of 10 by yourself!

    >
    > Oh well- forget it then!- waaaaa...ay too much thinking required....


    :)


    --

    John Devereux
     
    John Devereux, Dec 24, 2005
    #10
  11. M. Noone

    M. Noone Guest

    Looks good - I'll hold on to that for the future. Thanks,

    -M. Noone
    John Devereux wrote:

    >
    >
    > I once knocked up a C program that you are welcome to try, or perhaps
    > expand on.
    >
    > It has a very lazy algorithm that searches all combinations of 2 and 3
    > resistor dividers to find the closest match. You can customise the
    > first line of main() to choose between e6, e12 or your own resistor
    > value series. There are still plenty of configurations it does not
    > try, such as three resistors in series. Also you have to get the
    > correct power of 10 by yourself!
    >
    >
    > John
    >
    > ===============================================================
    >
    >
    > #include "stdio.h"
    > #include "math.h"
    >
    > /* The E12 series */
    >
    > float e12_base[]= { 1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2 };
    > float e6_base[] = { 1.0, 1.5, 2.2, 3.3, 4.7, 6.8};
    > float my_base[] = { 1.0, 1.5, 1.8, 2.2, 4.7, 6.8};
    >
    >
    > /* program to find the optimum series-parallel combination of
    > resistors, to get a given ratio */
    >
    >
    > float xyz1(float x, float y, float z)
    > {
    > return x/(1.0/(1.0/y+1.0/z));
    > }
    >
    > float xyz2(float x, float y, float z)
    > {
    > return x/(y+z);
    > }
    >
    > int main(void)
    > {
    > /* customise these three (6 or 12) */
    > float * base_series=e12_base;
    > int base_N=12;
    >
    > int decades=6;
    >
    > float target;
    >
    > int N=base_N*decades;
    >
    > int x,y,z;
    > float min_error=1E30;
    > float error;
    >
    > float ratio;
    >
    > int x_min, y_min, z_min;
    >
    > float series[N];
    >
    > int i;
    > float decade=1;
    > int n=0;
    > for(i=0;i<decades;i++)
    > {
    > for(x=0;x<base_N;x++)
    > {
    > series[n] = base_series[x]*decade;
    > printf("%f ",series[n]);
    > n++;
    > }
    > printf("\n");
    > decade *= 10;
    > }
    >
    > printf("Resistor series-parallel calculator program!\n");
    > printf("Calculates optimum combinations of resistors\n");
    > printf("to acheive a target ratio of resistance R1/R2\n");
    > printf("\n\n\nEnter target ratio (1.000-9.999):");
    >
    > scanf("%f", &target);
    > printf("Target ratio is %f\n\n", target);
    >
    > /* algorithm: two-resistor divider (Rx, Ry): for each Rx, Ry in
    > series, find minimum ratio Rx/Ry.
    >
    > */
    >
    > for(x=0;x<N;x++)
    > {
    > for(y=0;y<N;y++)
    > {
    > ratio = series[x]/series[y];
    > error = fabs(ratio-target);
    > if(error<min_error)
    > {
    > min_error=error;
    > x_min=x;
    > y_min=y;
    > }
    > }
    > }
    >
    > ratio=series[x_min]/series[y_min];
    > printf("\n\nBest ratio with two resistors is %f\n",ratio);
    > printf("Percentage error is %f%%\n",100*(1-target/ratio));
    > printf("Ry=%f\n", series[y_min]);
    > printf("Rx=%f\n", series[x_min]);
    >
    > min_error=1E30;
    >
    >
    > /* algorithm: three-resistor divider (Rx, (Ry||Rz)) */
    > for(x=0;x<N;x++)
    > {
    > for(y=0;y<N;y++)
    > {
    > for(z=0;z<N;z++)
    > {
    >
    > ratio = xyz1(series[x],series[y],series[z]);
    > error = fabs(ratio-target);
    > if(error<min_error)
    > {
    > min_error=error;
    > x_min=x;
    > y_min=y;
    > z_min=z;
    > }
    > }
    >
    > }
    > }
    >
    > ratio = xyz1(series[x_min],series[y_min],series[z_min]);
    >
    > printf("\n\nBest ratio with 3 resistors (Rx, (Ry||Rz) is %f\n",ratio);
    > printf("Percentage error is %f%%\n",100*(1-target/ratio));
    > printf("Rz=%f\n", series[z_min]);
    > printf("Ry=%f\n", series[y_min]);
    > printf("Rx=%f\n", series[x_min]);
    >
    >
    > /* algorithm: three-resistor divider (Rx, (Ry+Rz)) */
    > min_error=1E30;
    > for(x=0;x<N;x++)
    > {
    > for(y=0;y<N;y++)
    > {
    > for(z=0;z<N;z++)
    > {
    > ratio = xyz2(series[x],series[y],series[z]);
    > error = fabs(ratio-target);
    > if(error<min_error)
    > {
    > min_error=error;
    > x_min=x;
    > y_min=y;
    > z_min=z;
    > }
    > }
    >
    > }
    > }
    >
    > ratio = xyz2(series[x_min],series[y_min],series[z_min]);
    >
    > printf("\n\nBest ratio with 3 resistors (Rx, (Ry+Rz) is %f\n",ratio);
    > printf("Percentage error is %f%%\n",100*(1-target/ratio));
    > printf("Rz=%f\n", series[z_min]);
    > printf("Ry=%f\n", series[y_min]);
    > printf("Rx=%f\n", series[x_min]);
    >
    >
    > return 0;
    > }
    >
    >
    >
    >
    >
    > --
    >
    > John Devereux
     
    M. Noone, Dec 24, 2005
    #11
  12. M. Noone

    Fred Abse Guest

    Re: calculator for resistive divider using standard resistor values?

    On Sat, 24 Dec 2005 12:29:26 +0000, John Devereux wrote:

    > /* The E12 series */


    That's a bit restricted.

    --
    "Electricity is of two kinds, positive and negative. The difference
    is, I presume, that one comes a little more expensive, but is more
    durable; the other is a cheaper thing, but the moths get into it."
    (Stephen Leacock)
     
    Fred Abse, Dec 24, 2005
    #12
  13. Re: calculator for resistive divider using standard resistor values?

    Fred Abse <> writes:

    > On Sat, 24 Dec 2005 12:29:26 +0000, John Devereux wrote:
    >
    >> /* The E12 series */

    >
    > That's a bit restricted.


    Yes, my interest was in getting as close as possible with a *limited*
    range of part values.

    You can edit the program to put whatever sequence you like in. That's
    what the my_base array was for, just fill it in with E96 or whatever.


    --

    John Devereux
     
    John Devereux, Dec 24, 2005
    #13
  14. M. Noone

    Bob Monsen Guest

    On Fri, 23 Dec 2005 12:37:52 -0800, M. Noone wrote:

    > Hi - I feel like I saw this somewhere but have since lost the link. It
    > was a website where you could put in the ratio you want a resistive
    > voltage divider to give, and it would give you combinations of standard
    > resistor values that would yield that ratio.
    >
    > Anybody know of anything like this?
    >
    > Or are there any tricks to finding these values that I'm just not aware
    > of?



    I wrote a javascript version a year of two ago:

    http://home.comcast.net/~rcmonsen/resistors.html

    --
    Regards,
    Bob Monsen

    My dear, I used to think I was serving humanity’¡Ä and I pleasured in
    the thought. Then I discovered that humanity does not want to be
    served; on the contrary it resents any attempt to serve it."
    ~ Jubal Harshaw
     
    Bob Monsen, Dec 24, 2005
    #14
  15. M. Noone wrote:
    > Hi - I feel like I saw this somewhere but have since lost the link. It
    > was a website where you could put in the ratio you want a resistive
    > voltage divider to give, and it would give you combinations of standard
    > resistor values that would yield that ratio.
    >
    > Anybody know of anything like this?
    >
    > Or are there any tricks to finding these values that I'm just not aware
    > of?


    Yes, at http://www.ibrtses.com/products/index.html
    download http://www.ibrtses.com/products/teiler22.zip

    Rene

    --
    Ing.Buero R.Tschaggelar - http://www.ibrtses.com
    & commercial newsgroups - http://www.talkto.net
     
    Rene Tschaggelar, Dec 26, 2005
    #15
  16. M. Noone

    Dave F. Guest

    Dave F., Jan 4, 2006
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dude
    Replies:
    3
    Views:
    625
  2. Jon Slaughter
    Replies:
    1
    Views:
    268
  3. Rick Nungester

    Standard Resistor Values: Why not a true geometric series?

    Rick Nungester, Oct 15, 2007, in forum: Electronic Design
    Replies:
    197
    Views:
    3,253
    John Larkin
    Oct 24, 2007
  4. danny davis

    How to added up a Resistor Value using misc values

    danny davis, Jun 15, 2012, in forum: General Electronics Chat
    Replies:
    88
    Views:
    1,821
    CocaCola
    Jun 28, 2012
  5. joeyb
    Replies:
    3
    Views:
    322
    mechatronix
    Feb 18, 2013
Loading...

Share This Page