Maker Pro
Maker Pro

calculator for resistive divider using standard resistor values?

M

M. Noone

Jan 1, 1970
0
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
 
K

Ken Taylor

Jan 1, 1970
0
M. Noone said:
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
 
M

M. Noone

Jan 1, 1970
0
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!
 
R

Rich Grise, but drunk

Jan 1, 1970
0
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
 
K

Ken Taylor

Jan 1, 1970
0
Joerg said:
Hello Ken,



Cool. I've always use a slide rule calculator for that. Well, maybe I'll
keep doing that.

Regards, Joerg

Misattributed, but I'll take any collateral accolades.

Ken
 
J

John Devereux

Jan 1, 1970
0
M. Noone said:
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;
}
 
F

Fred Bloggs

Jan 1, 1970
0
Also you have to get the
correct power of 10 by yourself!

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

M. Noone

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

-M. Noone
John said:
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;
}
 
J

John Devereux

Jan 1, 1970
0
Fred Abse said:
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.
 
B

Bob Monsen

Jan 1, 1970
0
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
 
R

Rene Tschaggelar

Jan 1, 1970
0
M. Noone said:
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
 
Top