Help take a look at ADP5350 in link below. It may be of help but not fulfill all your requirement.http://www.analog.com/en/products/power-management/battery-management/battery-charger-ic/adp5350.html#product-overview
We have several options for battery charge control IC's that will perform several of the functions you have outlined. As the previous reply stated the ADP5350 has charging protection, state of charge information (SoC), and automatic switch over between USB and battery operation. You could combine this with an ideal diode circuit (http://cds.linear.com/docs/en/product-selector-card/2PB_Linear_idealdiodesfc.pdf) to select the appropriate input source. Another option would be to use an IC like the LTC3455/LTC3455-1 (http://www.linear.com/product/LTC3455) which provides input selection, charging, and additional power outputs, but then a coulomb counter (battery fuel gauge) IC could be used to monitor SoC. I would recommend looking at the ADI battery charger ICs (http://www.analog.com/en/products/power-management/battery-management/battery-charger-ic.html) and the Linear Technology battery management webpages(http://www.linear.com/products/Battery_Management) to find products that perform the functions you want and piece together your preferred solution.
One thing you will notice is that the USB chargers typically only charge a single cell. When stacking multiple cells it is necessary to monitor the voltages across each cell to make sure they stay equal during charge and discharge. This adds a bit more complexity to the design, so if you can get by with a single cell you will find the design task much easier.
If you need to supply a higher output voltage than the battery, you can use a boost converter to create that output. A buck-boost power supply is commonly used when the output voltage is near the voltage range of the battery, for example if you want a 3.3V output, the battery voltage can vary between 3.2V and 4.2V. If the voltage is lower like 1.8V you can use a buck converter or a linear regulator for low current. These devices will be found under switching and linear regulators. Some of the battery IC's will have these functions built in as well.
Technically you could charge a separate external device through the same port as long as there is enough power to run both devices, but I would not recommend it. With a USB power source you are limited on input power and many of the USB charger IC's will manage the power in the IC to not exceed the USB specifications. Any additional load could exceed the USB ratings and cause damage.
Your motor is running near or exceeding the 2.5W max power from a USB port, you might look to see if you can find a lower current motor. The 2-5Ah is a capacity specification, at 200mA a 2Ah battery would last approx. 10hours. You can estimate the battery AH rating by figuring out the current draw and multiply it by the required run time. 0.2A x 5 hours = 1Ah or 1000mAh
Thanks for the detailed response. For simplicity now, I think I'll nix the option of charging another device, as well as running on the USB power. I want to focus on the basic function of charging and monitoring a Li-Ion battery. Two Li-Ion batteries in series (7.2 V) should be the voltage I need, I won't need to go higher.
So one question I just want to make sure of, if I buy a battery pack like this one, where the two cells are in series and you can't monitor the middle point, are the batteries likely to go bad quicker than if there was battery balancing?
Assuming I can still use that battery pack, I looked at some of the great resources you sent me, and came across the LTC2943 and LTC2943-1. They seem made for measuring exactly the kind of battery pack I want, and the last page in their datasheets led me to the LTC1732-8.4, which also seems like the perfect charger, except it can't run on USB voltage. Are there any chargers that run on 5V but will charge 8.2V battery packs? I think something like the LT1512 or LT1513 should work right, although it would be a bit more complicated because I need to design the external components for the charging profile I want. I think the only circuit I'd need would be that one on the last page of of the LTC2943 datasheets but with one of those chargers instead? Unless there's a chip that does both charging and gauging, but I'm assuming that would be rare for one that can take a 5V input and charge 8.2V. Are there any chargers or gauges that monitor temperature also?
If buying the battery packs like that are worse for the battery and it would be better to get two separate cells, then I'd look into that. Is it common to find a charger that will also balance the 2 cells (keeping in mind I want it to run on 5V also)?
Also, as a battery monitoring novice, I see that the LTC2943 will give my microcontroller all the information I'd want to know about the battery - the voltage, current, charge accumulation, etc... But how do I take that information and conclude a percentage "battery life" from all that information?
Thank you very much!
Sorry for the slow reply, I am currently travelling..
You can use a battery like the one you have linked. It has some internal protection A positive temperature coefficient fuse (PTC fuse) and advertises around 1000 charge discharge cycles. Individual cells with balance charging would most likely have a longer lifetime and could be charged at a faster rate safely, but that would add cost to your design. You can evaluate if the additional cost and complexity are worth the tradeoffs.
You can use a charger such as the LTC1732-8.4 if you also add a boost converter to the design. If you look at the switching power regulators you can find one that will take 5V in and boost the voltage to 10V or 12V to supply the charger IC. There are several to choose from that can supply the power you require.
The charger you listed does have temperature measurement internal to the IC, but if you want to remotely monitor the battery pack temperature and read it back to the microcontroller, you might need to have an additional temperature monitor such as a thermistor.
There are a few ways to estimate charge percentage. The information that you have access will give you very accurate monitoring of the charge level. You can track the charge current and the time (Amps*hours) to determine the amount of capacity either added or subtracted from the battery. SoC(%)= (Amp hours remaining/Total battery Amp hours)*100.
Alternatively, you can measure the battery voltage to estimate the charge level but it is not as accurate, but is done fairly often in simple devices. if you measure several charge and discharge curves of the batteries you intend to use, you can estimate the voltage on the battery at different charge levels. This will allow you to read the battery voltage and have the microcontroller estimate the remaining charge based on typical battery curves.
Hopefully this information keeps you moving in the right direction.