2

Author Topic: need help programing adc to measure resistance  (Read 1104 times)

0 Members and 1 Guest are viewing this topic.

Offline lcabTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
need help programing adc to measure resistance
« on: February 11, 2010, 07:39:03 PM »
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 microprocessor can anybody help point me in the right direction because i am not sure how to approach this situation. i have read about the adc but still not to sure how it works.thanks

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,943
  • Helpful? 98
Re: need help programing adc to measure resistance
« Reply #1 on: February 12, 2010, 08:42:02 AM »
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.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: need help programing adc to measure resistance
« Reply #2 on: February 13, 2010, 10:54:08 PM »
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.

 


Get Your Ad Here