Battery technology has improved since 2015, when I replaced the NiCd cells with NiMH in a cordless drill. The cost of the NiCd has dropped and their capacity increased. But most cordless tools now use lithium batteries. Each brand of tool uses its own proprietary battery pack. But I was able to adapt a new lithium battery pack from a budget brand to fit my old drill.
While the battery packs from different brands look different, these mostly contain the same AA size lithium 3.7 volt cells (with more cells used for higher voltages). These cells are a higher voltage and energy capacity than the NiCd cells used in older tools. Whereas it took 10 NICd cells for a 12 Volt battery, it takes only three small Lithium ones.
I considered buying lithium cells and building my own battery into the old cordless drill case. As these lithium cells are much smaller, there is plenty of room. However, the lithium cells have an increased risk of fire if mishandled and need special charging to prevent damage. So instead I bought a 12 Volt Lithium battery designed for a budget range of tools with a matching charger (there is also an 18 Volt range).DC socket in the bottom of the drill to connect to the charger. The battery was then wrapped in self amalgamating tape to protect it and hold it in place.DC plug. The electronics for regulating charging of the lithium battery are in the circuit board on the battery, so there is no extra electronics required. Light Transporters. These have a clip which fits over the LEDs on the charger board, and a fiber optic cable to channel the light out.
This amount of effort was not really worth it in strict money terms. A new 12 volt drill would have not cost much more than the battery and charger alone. However, there was nothing wrong with my old drill.
Fitting a new battery would make more sense for more expensive cordless tools, or where you have a range of tools. The most complex part of the upgrade was fitting the new cells inside the old battery case. A simpler approach would be to remove the old cells and fit a short lead with a DC plug on it. Then fit a short lead with a matching DC inline socket to a new lithium battery pack (perhaps with an inline fuse for protection). The battery could be attached to the bottom of the old pack, or just left loose on a short cable.
This approach of using an external battery would be particularly useful if you have multiple tools which are the same voltage, but different brands. The same size plug can be fitted to each tool and then all used with one battery pack and charger.
Please note that fitting a battery requires a reasonable familiarity with electronics. While the voltages are low, there is a risk from batteries exploding, or catching fire, if not wired correctly. I have not described exactly which wire to connect to which contact on the battery. If you are not skilled enough to work this out with a multimeter, yourself, then you should not be attempting this upgrade.