Philip Pemberton wrote: > So far the best idea I've come up with is to have swappable battery holders > and a voltage divider. The pulldown resistor is in the charger, the input > resistor is in the battery holder. A five-pin connector connects the pack to > the charger (2 pins for +/-, one pin for sense, two pins for telling the > charger how many cells the holder is designed for. Can't you tell that just from the value you set for the reference voltage? Seems to me 3 pins is all you need since the number of cells also determines the reference voltage you want. > Or I could redesign the voltage amp using a digital potentiometer or > something. Or something. 1% resistors attached to tri state pins on PIC to change values in binary. If you're clever about the R values you can probably get away with ONE pin. Low, Tristate, High for 1, 2, 4 cells. > Divide it down as if there was a four-cell pack connected, then use > the digipot to vary the gain of an op-amp stage... Decisions, decisions. See above. You can use diodes to give you different R values for pull up and pull down, if you don't mind their change in voltage drop with temperature (which can be compensated by a matching diode elsewhere in the circuit). R -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist