Nerd Ralph writes:
As various sites explain, lithium-ion rechargeable batteries should be charged to 4.2 volts. USB ports provide 5V, so all I needed was a way to drop 5V down to 4.2 or less. Standard diodes have a voltage drop of 0.6 to 1.0 volts, so I pulled up the datasheet for a 1n4148, and looked at the I-V curve
A standard USB port should provide up to 500mA of current, enough for charging a small camera battery. A fully-discharged li-ion battery is 3V, and will climb to 3.8V within minutes of the start of charging. Line 2 in the graph indicates a 1.2V drop at 350mA of current. Under load the voltage output of a USB port will drop a bit, so with 4.9V from the USB port and 3.8V drop at the battery, the charging current will be around 250mA (where 1.1V intersects line 2). Looking at the numbers, a single 1n4148 diode would work as a battery charge controller.