0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

I am a newbie and this may not be a tough one. I am using Arduino UNO and trying to find the unknown resistance with the above schematic.

But when no input is connected the ADC pin it gives a random reading and when I connect an input it directly shows 1023 as analog reading. What is the problem here ? And also if I get proper ADC reading, can the unknown resistance value will be properly found with the above voltage divider? The voltage is measured between the ADC pin and Gnd pin. Is that OK?

I would be doing it like: \$ \large V_{R1} = VCC \times \frac{R_1}{R_1 + R_2} \$ and then finding out \$ \large R_2 \$

\$\endgroup\$
  • \$\begingroup\$ Please use italics for emphasis and not for the whole post and capitalise "Arduino" and "Uno" properly for readability. If you leave the ADC input floating you can expect random readings due to high input impedance of the ADC. Your formula looks right. \$\endgroup\$ – Transistor May 22 '16 at 8:45
  • \$\begingroup\$ sure next time i ll do...okay so can i use a pull-down resistor to prevent the floating inputs ? \$\endgroup\$ – kaya May 22 '16 at 10:05
  • \$\begingroup\$ First as pointed out by @Neil_UK your ADC is off scale. 1. What is the supply source, i mean its arduino 5v, or 3.3V or some external source? 2. Can you share some details, as in what is the voltage you observe at the ADC pin? Generally Arduino compares against 5V, means 1023 will correspond to 5V at its analog pin, looking at your circuit its highly unlikely unless the resistor is in range of few ohms (or miliohms), which i assume is not the case. So you have to provide test results for us to decipher anything out of it. \$\endgroup\$ – Mayank May 22 '16 at 10:26
1
\$\begingroup\$

A reading of 1023 means your ADC is off scale, that is, its input voltage is higher than the reference.

Be aware that you can select several different sources for the ADC reference, including VCC (which from your question context I suspect you thought you were using), but it can also be 1.1v, and an external voltage. Off the top of my head, I don't know which is the default.

Once you have selected VCC as your ADC reference, then your formula for the voltages based on R1 and R2 is correct.

\$\endgroup\$
  • \$\begingroup\$ okay so i will try to do with its internal reference . \$\endgroup\$ – kaya May 22 '16 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.