----- Original Message -----=20 From: "ivp" To: "Microcontroller discussion list - Public." Sent: Friday, September 24, 2010 6:44 PM Subject: Re: [PIC] Reading DIP switch with A/D >> How about a series arrangement instead of parallel? Wire four resistors >> in a 1/2/4/8 ratio in series, each of which can be shorted by one of the >> dip switches >> >> A quick spreadsheet shows that with the values in the ratio >> >> 1/2/4/8 + 16 >> >> then the full scale value is about 48% of +V >> and the minumum delta between two adjacent values is about >> 1.7% of +V. This corresponds to about 17 ADC counts. > > That arrangement is a little better than the 15 difference with parallel > resistors > > Also, the circuit includes a PIC-driven voltage doubler (work in > progress, attached) for hard-pulsing a small solenoid valve, so that > could be used to power such a network with almost Vdd * 2 to > compensate for the loss and ~ double the difference > > The coincidence comes about because this is for a small battery- > powered (3 x AA) butane injector. Interval1 is the injection time, > Interval2 is the mix time before spark. Once parameters have been > optimised (temperature might come into this too) in the test rig, the > resistors will be removed or rendered ineffective to save power in > the field > > Joe Joe, You might want to compare the sensistitivity of the parallel and serial=20 schemes to variations in the resistor value. I also looked into it deeper, and the 'best' value for the source resistor= =20 is about 14.5 rather than 16 to maximize the minimum delta. -- Bob=20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .