Some advice on charging circuit used in simple UPS
If I understand you correctly, you want a charger than can switch between battery and input source (i.e. when adapter is plugged/unplugged) to power the load.
There are plenty of charge control ICs and circuits around that can do this. The MCP73831 is a nice cheap little Li-Ion charge IC, and with the addition of a PMOS/Schottky, can switch between adapter and battery. Here is an example circuit:
The output is at the top right where the wire disappears (from the PMOS/Schottky)
Here is an Microchip app note which goes into some details on such a circuit.
The way it works is when the USB power (or adapter) is not present, the VUSB_IN line gets pulled to 0V by R4. This brings the gate of the PMOS (G on the symbol) to ground and turns it on (i.e. opens the Source-Drain, marked S and D) allowing the battery to power the circuit. The Schottky (marked A and K) stops the battery raising the VUSB_IN line and turning the PMOS off again.
when the adapter is plugged in, the gate is pulled to +5V and the PMOS turns off, leaving only the adapter voltage powering the circuit and letting the battery charge.
I share my experience, which took a long time of googlin and testing but finally I found a cheap, compact and nice solution. My goal was to build up a 5V UPS for Raspberry Pi, to avoid SD writing problems due to power cuts; anyway this tutorial can be suitable for anyone who wants to build up his own power bank too.
Material:
Lithion Battery (I used my old Jiayu G3T 3000mAh battery)
5V to 3V Logic Level converter
3.7V Li-ion Battery Mini USB to USB A Power Apply Module 5V 1A Charge Module (find it here)
Costs:
Battery: depends on your needs, in my example I took a 3000mAh which means that with a load of 1000mAh (average RasPi consumption) it can last up to 3hrs. Cost: 5,50€
Level converter: the cheapest, 1,50€
Power module: ca. 3€
Total: ca. 10€
Assembly:
I used the battery as mounting surface because it's nice and squared; a little bit of isolating sponge and sticky tape and some basic soldering and I get a 6 x 6 x 1,5cm little UPS package.