This is a simple battery holder that can be customized to hold from 1 to x number of batteries. It has already been tested with AAA, AA and 18650 batteries. You can easily adapt the holder to accommodate your own battery sizes.
The holder can be connected to an arduino with capacitance measurement software. This allows you to easily keep track of the batteries' capacity.