Some workbenches can’t help ending up looking like a rats nest of cables and equipment, so its always an advantage if a piece of mains equipment can be removed from somewhere to free up an extra mains socket. Here we are using the ubiquitous PC as a battery charger. An unused serial interface port can supply enough current to charge (or trickle charge) low-capacity Nickel Cadmium (NiCd) batteries. You could for example, use the batteries in a radio and charge them during use.
The three serial port connections TxD, DTR, and RTS, when not in use, are at –10 V and can supply a current of around 10 to 20mA (they are short-circuit protected). The circuit shown supplies a charging current of approximately 30mA. If it is necessary to alter the polarity of the charging circuit then it is a simple job to reverse the diodes and using software, switch the port signals +10 V. Those interested could also write a software routine to automatically recharge the batteries.