I had a similar project (adding storage to an existing system, requiring bumpless transfer between external and internal power sources) and selected NiMH. Your Li-ion situation will have significant differences and things may work just fine, but perhaps it's prudent to consider the possibility that it will be a lot harder than you expect!
I had two significant issues that will apply to your situation. The first is reliable end-of-charge detection. Lead acid batteries are a luxury in this department - the coarse voltage changes are easy to detect. For Li-ion and NiMH however, detection of full charge is much more subtle. In particular you will need a very good measurement of cell voltage (in the order of 10mV resolution) and most likely a very stable measure of cell temperature. These are not difficult per se, but if you combine the noise and duration of a switched mode charging circuit operating for hours on end, it's not hard to fall foul to the occasional measurement glitch, environmental drift or battery cell variation. In other words, keep your voltage and temperature measurement circuits neat and tidy!
The other problem was switching between power sources. Again, seems simple on the surface, but since the cell voltage of your batteries change over their charge cycle, you could be switching from and to a variety of different voltages. Additionally, the charging power supply might in one instance only be supplying the batteries and in another, suppling the batteries and the load. Consider early in the design whether it would be worthwhile putting a regulated DC-DC converter between your power supplies and the load. It may turn out that two DC-DC converters are required. Then of course you need to consider max current draw from the load and carefully evaluate the hold-up capabilities of the power supply variations.
I used the BQ2005 chip from TI for battery charging (and the BQ2010 for state-of-charge display). It was far from idiot-proof, but did the job in the end. There was still a consider amount of external circuitry to design, mostly to do with the switched mode power supply and signalling between the two chips.
Hysteresis was handled using a p-channel MOSFET plus a couple of schottky diodes to create an OR of the power sources. The MOSFET's gate was driven using the external power supply via a resistive divider. The resistive divider was tuned to ensure that switch over from internal to external power source and vice-versa was done before the load voltage dropped too far. This negated the need for significant capacitance to hold up the load voltage - a relatively standard amount of capacitance on the output of the DC-DC converter was enough.
I had a similar project (adding storage to an existing system, requiring bumpless transfer between external and internal power sources) and selected NiMH. Your Li-ion situation will have significant differences and things may work just fine, but perhaps it's prudent to consider the possibility that it will be a lot harder than you expect!
I had two significant issues that will apply to your situation. The first is reliable end-of-charge detection. Lead acid batteries are a luxury in this department - the coarse voltage changes are easy to detect. For Li-ion and NiMH however, detection of full charge is much more subtle. In particular you will need a very good measurement of cell voltage (in the order of 10mV resolution) and most likely a very stable measure of cell temperature. These are not difficult per se, but if you combine the noise and duration of a switched mode charging circuit operating for hours on end, it's not hard to fall foul to the occasional measurement glitch, environmental drift or battery cell variation. In other words, keep your voltage and temperature measurement circuits neat and tidy!
The other problem was switching between power sources. Again, seems simple on the surface, but since the cell voltage of your batteries change over their charge cycle, you could be switching from and to a variety of different voltages. Additionally, the charging power supply might in one instance only be supplying the batteries and in another, suppling the batteries and the load. Consider early in the design whether it would be worthwhile putting a regulated DC-DC converter between your power supplies and the load. It may turn out that two DC-DC converters are required. Then of course you need to consider max current draw from the load and carefully evaluate the hold-up capabilities of the power supply variations.
I used the BQ2005 chip from TI for battery charging (and the BQ2010 for state-of-charge display). It was far from idiot-proof, but did the job in the end. There was still a consider amount of external circuitry to design, mostly to do with the switched mode power supply and signalling between the two chips.
Hysteresis was handled using a p-channel MOSFET plus a couple of schottky diodes to create an OR of the power sources. The MOSFET's gate was driven using the external power supply via a resistive divider. The resistive divider was tuned to ensure that switch over from internal to external power source and vice-versa was done before the load voltage dropped too far. This negated the need for significant capacitance to hold up the load voltage - a relatively standard amount of capacitance on the output of the DC-DC converter was enough.