i am trying to write a program in c to measure the resistance across two terminals using my analog to digital converter on my microprocessor. We are using the a axon atmega640 microprocessor and i had received some help in the which was
waltr
Supreme Robot
Which microprocessor?
An ADC measures voltage and converts the voltage to a digital value that is dependent on the input voltage, the internal reference voltage and the number of bits of ADC resolution.
To measure a resistance you need to use Ohm's Law (E = I*R or R = E/I). So, apply a constant current (I) through the resistor and use the ADC to measure the voltage across the resistor then calculate the resistance.
Google will find tons of information on this.
Admin
Administrator
You'll need to make a voltage divider - two resistors in series.
Attach ground to one end, 5 volts to the other, and your ADC output in the center. The voltage measured, using Ohms law, will get you resistance.
Make sure you keep total current under 20mA, lower the better.
Use 10 bit ADC to get the best accuracy.
now i am asking
if i was using a 3-pin header cable to connect to the microprocessor and i connected the 5v to the left side of the terminal and the ground to the right side of the terminal and my output cable will start on the positive terminal then run over to the ground terminal then run into the middle pin on of the microprocessor pin. Theoreactcialy Will i get the right output resistance of the resistor being measured , because i am writing the code for it now but just though i would post what i was going to do to see if a more experience person could tell me if i was heading in the right direction. thanks.