Do you already solve your problem regards to the fluctuate value? If yes, could you tell me how you solve that. much appreciate your reply. Thanks

]]>keeping in mind that V out is the voltage drop across your unknown resistor R2

Isn’t it better to write : V out / Vin =R2/ (R1 + R2) ?

Thank you in advance ]]>

I find Rled = 4202.5 [ohm] / Vout = 3.52 [v]

aiming to verify the result I used the equation R2/R1 = (Vin/Vout) -1, and the measured resistance (Rled = 4202.5 [ohm])

I verified the measured voltage Vout = 3.52 [v].

applying voltage divider in the circuit (using an op. amplifier) gives the following equation

Vout/Vin = (R1+R2)/R1 which is different from the Vout / Vin = R1 / ( R1 + R2 ).

Where am I wrong?

P.S If the circuit is needed I can send you by email.

Thank you in advance,

PD

Vout / Vin = R2 / ( R1 + R2 )

And simplifies down to:

R2 = R1 / ( ( Vin / Vout ) -1 )

which would change your Arduino code from:

R2 = R1 * buffer;

to:

R2 = R1 / buffer;

Just wanted to point this for anyone who’s calculations show errors like mine did using a 10 ohm constant (R1) and 37.6 ohm “unknown” (R2) with the above math.

]]>Can you post your code?

]]>Any suggestion appreciated…

]]>float R1= 0;

float R2= 1000;

R1=R2/buffer;

Serial.print(“R1: “);

Serial.println(R1);

You could test to see if it’s a problem with analog pin 0 by removing R2 from the circuit. This should give you a Vout of 5V (since none of the voltage is sunk to ground), and an R2 of 0 (which is actually infinity). If this works properly, it’s probably a bad resistor that you’re trying to check, or a very big resistor, in which case you need to have a bigger R1 to get reliable values. If this doesn’t work properly, then your analog pin 0 is messed up.

If it’s your analog pin, simply moving the wire from analog pin 0 to analog pin 1, and modifying line 1 of the sketch to match your new analog pin should fix the problem. If that doesn’t fix it, then either your entire Arduino is screwed up, or it’s your connections. If it’s your connections… well, that should have been the first thing you checked!

]]>Vout = (raw * Vin) / 1024

raw = 492, Vin = 5

Vout = (492 * 5) / 1024

Vout = 2460 / 1024

Vout = 2.40234375

The value provided is close enough to be worth using unless you need ultra-precise measurements. With the Arduino Due and Zero, you can change the analog resolution to a 12-bit number, giving you values between 0 and 4095 if you need more precision.

]]>Vout / Vin = R1 / (R1 + R2)

Cross multiply:

Vout * (R1 + R2) = R1 * Vin

Divide both sides by Vout:

R1 + R2 = (R1 * Vin) / Vout

Subtract R1 from both sides:

R2 = ((R1 * Vin) / Vout) – R1

Simplify the right side:

R2 = (Vin / Vout – 1) * R1

Your circuitry was tested on various resistance and all the values displayed were correct.

Then I put 2×100 kOhms resistance in series to have a 200kOhms equivalent resistance (because the printer resistance is 100 kOhms, I was told) and the values displayed were then weird : Vout=0.1 to 0.12 max and R2= several MOhms… I also tried with only one 100 kOhms resistance, same kind of values.

What can I conclude ?

Thanks in advance. ]]>