With 2 resistors, yes.
In fact, using common resistor values, you have 637 possible resistor choices (not using the same resistors) and 806 (with using the same resistors).
Car voltage = 12v (clean source)
Arduino safe voltage 4v- 5v (I chose 4v- 5v, because 1v - 5v would result in 3324 possible combinations not using the same resistors, and 3493 with using the same resistors.
Resistor chart: http://ecee.colorado.edu/~mcclurel/resistorsandcaps.pdf
/*
Vsource
|
|
[R1]
|
x-----------Vout
|
[R2]
|
|
GND
*/
float CommonRes[24] = {
1.0, 1.1, 1.2, 1.3, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.7,
3.0, 3.3, 3.6, 3.9, 4.3, 4.7, 5.1, 5.6, 6.2, 6.8, 7.5,
8.2, 9.1
};
void setup()
{
Serial.begin(115200);
ResistorCalc(12, 4, 5, false);
//FindR1(3357.14, 12, 5);
//FindR2(4700, 12, 5);
}
void loop(){ }
void ResistorCalc(float Vs, float Vo1, float Vo2, bool show)
{
float R1, R2, possibleVoltage;
unsigned long count = 0, With_Duplicates = 0;
for (byte i = 0; i < (24 * 7); i++)
{
R2 = (CommonRes[i % 24] * pow(10, (i / 24)) );
for (byte j = 0; j < (24 * 7); j++)
{
R1 = (CommonRes[j % 24] * pow(10, (j / 24)) );
possibleVoltage = (Vs * R2) / (R1 + R2);
if (R1 != R2)
{
if ((possibleVoltage >= Vo1) && (possibleVoltage <= Vo2))
{
count++;
if (show)
{
Serial.print(count);
Serial.print(" ");
Serial.print(R1);
Serial.print(" ");
Serial.print(R2);
Serial.print(" ");
Serial.println(possibleVoltage);
}
}
}
else With_Duplicates++;
}
}
Serial.print("No Dups: ");
Serial.println(count);
Serial.print("With Dups: ");
Serial.println((count + With_Duplicates));
}
void FindR1(long R2, float Vs, float Vo)
{
Serial.println( ((Vs * R2) - (Vo * R2)) / Vo);
}
void FindR2(long R1, float Vs, float Vo)
{
Serial.println( (Vo * R1) / (Vs - Vo));
}