3.6V NiMH smart charger, microcontroller, auto switch over from DC in to battery
I have designed a simple circuit to charge NiCd batteries. The circuit continuously monitors the voltage of batteries. If the voltage drops, the batteries are being charged.
However, it is not exactly what you need, but it may give you some hints to design your own circuit. Here is the schematic:



More details can be found here.