I never think of everything in time.
The analog mux chips give me 16 channels to connect to individual cells. For NiCd, that’s a max of 16*1.2V=19.2V packs. That covers almost all battery packs – great.
But the discharger also needs to be able to look at end-to-end battery voltage to know when to turn off the discharge relay. I need to put a divider across the (heavy) discharge leads so we have a scaled voltage to measure that’s never > 5V. But I can’t just leave an extra analog input permanently connected to the divider tap and set up for cell #0 to get ground patched to the bottom of the battery: That would work for the measurement, but for other cells, ground could be many volts above the divider tap – probably blowing out the analog input! So I have to be able to switch both ground and an mux input connected to the divider tap – just like I do for all the individual cells.
I’ve considered spending one channel of my 16 for that. It would take some hacks to the PCB – ugly but doable – and cost one cell of capacity. 15 cells is still 18V, which still covers almost all battery packs.
But I also cleverly put a 0.1Ω current sense resistor on the board. The original plan was to put a voltmeter on it to get a reading of actual discharge current. But much cooler would be to have an A/D read it. That would not only be simpler (no extra step with a voltmeter), but it could read the actual current at each sample, giving a more accurate cell capacity measurement.
BUT – that would take yet another channel. I really don’t want to go below 18V. So I’m looking at somehow sticking 4 more SPST switches on the board to pick up those 2 extra readings. Part of why I chose the DG406 analog switch I chose was that the analog range was independent of the logic control voltage. I don’t think I can just use a 4066 or something because the voltages are too high. There are other smaller mux chips in the same family as the one I used (including its 44V safe input range), but they’d require yet another order to DigiKey. I guess I really need to think about that some more.
(For reference: The control signals are always normal 5V logic from the Arduino. Since all analog measurements are with respect to Arduino ground, we have to connect the bottom of the cell being measured to “ground”, as well as the top of the cell to the analog input. That means other mux pins may be up to 19V away from “ground” at various times. I think the 406 can handle that, but I guess we’ll see the first time I fire it up 🙂 )