Uggghhhh... NOT low value Resistors for a Potential Divider measuring VOLTAGE... you need the highest value ones you can get away with... The lower the value, the more current consumption and the more heat. The opposite is true is you want to measure CUURENT (which is not the case in this instance).
Take an example R1 and R2 connected in Series. The top-end of R1 connects to the Supply to be measured. The bottom-end of R2 connects to Vss (0v). The junction of R1/R2 connects to the PIC's ADC pin.
The Recommended ADC input impedance is around 10K (unless it's a 12F which is around 2K), so R2 is recommended at that value (a decoupling capacitor say 100nF is also good accross R2 to kill any noice that might upset our readings). R1 will now depend on the voltage to be measured.
If you select 10K for R1 and for R2, then you will get a Reduction Ratio of R2/R1+R2 ie (10000/(20000) which is 1/2 or 0.5. 12v in will give you 6v out (12 * 0.5), which is not enough reduction for our ADC's 5v maximum. Trying 15K for R1, we get 10000/25000 which is 0.4... 12v input x 0.4 = 4.8v reduction which is now in-range for our ADC.
Always plan to measure your maximum voltage. Is your fully charged Battery 12v? You might find it's a little higher. To calculate the maximum voltage that we can measure, work backwards... 5v (our +VRef) / 0.4 (the reduction in our 15K R1 example) = 12.5v (maximum voltage we can measure).
Finally, use High Tollerance 1% or better Resistors. No point in trying to measure microvolts when crappy Resistors could give you half a volt error. And if you want some better precision, REF-02 or other Precision Voltage Reference won't tie you to the wide tollerances of the usual 5v Regulator chips.
But then again, if you're only worried that your R/C plane is running out of juice and in danger of hospitalising some innocent bystander, you don't exactly need laboratory precision.
Melanie
Bookmarks