Battery management system for my battery packs
I think you should use a differential amplifier to monitor each battery cell. You need to use ADCs (4 channels) from the uC to measure the battery cell voltages. You can then balance the cells by turning on the PWM signals in according the cell voltages. You may test your battery cell balancing implementation and algorithm by using a battery simulator for each cell. You can use the battery simulator to vary each cell to test your balancing circuit.