Use an LM317 (or LM780x) in constant current mode. See the datasheet for specifics on how this is done, but basically, connect a resistor from the common terminal of the 317 (780x) to the output terminal. =20 And from the output terminal through your resistor string to gnd. You now have a constant current through your resistor string. LM317 or 780x regulators are less than a dollar almost anywhere. Regards, Jim > -------- Original Message -------- > Subject: Re: [PIC] Reading DIP switch with A/D > From: Dwayne Reid > Date: Tue, September 28, 2010 11:28 am > To: "Microcontroller discussion list - Public." >=20 >=20 > At 07:03 PM 9/27/2010, RussellMc wrote: >=20 > >Using a constant current source gives even better results - not needed > >with only 4 switches. >=20 > The problems (several) with using constant-current source (or sink)=20 > is: extra component cost and accuracy. >=20 > Its HARD to make a very low cost constant current source that is=20 > reasonably accurate. >=20 > You can still purchase constant current diodes but they are expensive=20 > and need significant supply voltage (at least 3V higher than the=20 > highest A/D input voltage used). >=20 > You can use the old 2-transistor constant current source but its=20 > current varies with temperature. >=20 > You can use an op-amp and a transistor - works well but uses a TON of=20 > components. >=20 > Unless you can suggest something I haven't mentioned. >=20 > Don't get me wrong - I think that reading a string of resistors with=20 > a constant-current source is the ideal way to tackle this=20 > problem. Its just that the cure seems to be way worse than the=20 > original problem. >=20 > dwayne >=20 > --=20 > Dwayne Reid > Trinity Electronics Systems Ltd Edmonton, AB, CANADA > (780) 489-3199 voice (780) 487-6397 fax > www.trinity-electronics.com > Custom Electronics Design and Manufacturing >=20 > --=20 > 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 .