Shop OBEX P1 Docs P2 Docs Learn Events
Resistance measurements on the Javelin — Parallax Forums

Resistance measurements on the Javelin

PyrotomPyrotom Posts: 84
edited 2005-11-28 18:03 in General Discussion
My application for the Javelin requires measuring small resistance values (0-200 ohms) with reasonable accuracy. I'm not really an electronics expert, but I think I understand this reasonably well. The resistance measuring circuit in chapter 9 cannot be used as shown for low resistances because the voltage divider created by the 220 ohm resistor and the device under test will never let the voltage on the capacitor rise to above 2.5 volts.

So I moved the 220 ohm resistor to be in series with the value to be measured, thus still protecting against a short to ground, but letting the capacitor discharge. This works, but the total resistance is low enough that the 1 uF capacitor charges so fast that the RCTime count is not high enough to get any precision on my measurement. So I switched to a 68uF tantalum capacitor. Now I get high enough counts to get the precision I need, and all would seem happy.

The problem is repeatability. If I run the test 20 times, about 15 or so of the counts will be quite consistent, but the others will be off (usually low) by quite a bit. Why is this happening? Is there anything I can do about it (other than taking a lot of measurements and throwing out the outliers, which I'm reluctant to do because it really slows things down, and I need to check a whole lot of values)? Am I on the right track at all for measuring small resistance values?

Comments

  • PyrotomPyrotom Posts: 84
    edited 2005-11-18 22:00
    tongue.gif Solved my own problem! I created a voltage divider with a 220 ohm resistor and my resistance to be measured, and then measured the voltage on the divider with the ADC circuit. This works quite well and gives me about 2 ohm resolution, which is plenty accurate for my application.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-11-19 17:44
    Can you post a schematic of your setup?

    regards peter
  • PyrotomPyrotom Posts: 84
    edited 2005-11-28 17:03
    OK, here it is (I think). R are 10K, the capacitor is 1.0uF, as given on page 160 of the manual. R2 is 100 ohms. R2 and the unknown resistance form a voltage divider, so the voltage being tested by the ADC circuit is Vcc * (Runknown / (100 + Runknown)). If we solve for Runknown, we get Runknown = (100 * Vadc) / (Vcc - Vadc). I don't need to know the real voltages, so I can just use the raw counts returned by the ADC. This works quite well for resistances in the range 0-200 ohms, which is what I needed.

    I uploaded the circuit as resistance.gif using the Attachment manager - I hope that it works!
    433 x 254 - 7K
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-11-28 17:16
    Very nice.

    You know that Vadc = (adcvalue/256)*VCC

    Substituting in your formula gives

    Runknown = 100*adcvalue/(256-adcvalue); no division by zero possible (adcvalue = 0-255)

    For adcvalue = 128 (0.5*Vcc) you get of course Runknown = 100.

    regards peter
  • PyrotomPyrotom Posts: 84
    edited 2005-11-28 17:27
    Right. I actually used the ADC to see what it returned for Vcc - it was a little less that 256, I can't remember the actual value. My situation was actually a little more complicated - I'm measuring the resistance of firing circuits in a pyrotechnics controller, and need to keep the current through the measured circuit quite low to prevent accidental firings. The 50 milliamp maximum using a 100 ohm resistor was a little higher than I wanted, so my actual circuit uses a 220 ohm resistor. To keep the numerator under 32K, I shifted all of the ADC values right one bit before doing the calculation.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-11-28 17:59
    So you use 220 ohm instead of 100.
    You can increase the 10K resistors to 22K giving the same
    accuracy·as with 100 ohm and 10K resistors.

    regards peter
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-11-28 18:03
    Rewrite your formula as

    Runknown = ((110*adcvalue)/(256-adcvalue))*2;

    Then you don't need to shift.

    regards peter
Sign In or Register to comment.