I think I did a version of this that used 6 switches or so. IIRC I found the best solution was to feed the the power via a constant current source. That way the voltage across the resistors was directly proportional to the resistance & I had a larger working voltage range and well defined voltages. RP On 24 September 2010 03:10, Olin Lathrop wrote: > William Bross wrote: >> Can you flip the circuit around so the single resistor goes to ground >> and Vdd is sourced to the four switchable resistors? =A0If so, it makes >> calculating the divider ratios easier. > > Huh? =A0It's the same thing, just with the Vss to Vdd range flipped. =A0E= ither > way the A/D can read the signal and the firmware has a equal chance of > making sense of it. =A0Neither way is more "right" than the other. > > One approach to Joe's problem is to think of the switches as bits of a D/= A > and wire them up in a R-2R ladder. =A0That spreads the values out evenly = and > doesn't require several strange resistor values. =A0You can chose any two= 1% > values with a 2:1 ratio over a reasonably wide range. =A0At one end you w= ant > to not exceed the A/D's input impedence requirement. =A0At the other end,= you > don't want to draw excessive current. > > To limit current, you could turn the whole thing on only for a short time > around taking the measurement, and use something nice and simple like 1.0= 0K > and 2.00K ohm resistors. > > > ******************************************************************** > Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products > (978) 742-9014. =A0Gold level PIC consultants since 2000. > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .