This circuit exploits all the power available from a USB port by dynamically adjusting the amount of current delivered to the load, thereby siphoning a relatively constant (and maximum) current from the USB port. Included are a current-sense amplifier (MAX4173), voltage reference (MAX6129), and precision op amp (MAX4238).
A similar version of this article appeared in the December 15, 2006 issue of EDN magazine.
USB ports can be a handy source of 5V power. Not only can a USB port power a microcontroller and other essential circuitry, it often has enough current headroom left over to charge an energy-storage element such as a small battery or super-capacitor. The typical approach is to estimate the maximum current drawn by the essential circuitry, and then place an appropriate current-limiting device in the path of the energy-storage device (Figure 1). Though simple, this method doesn't utilize all of the available USB current. It therefore takes longer to charge the energy-storage device.
The circuit of Figure 2 exploits all of the available USB power by dynamically adjusting the amount of current delivered to the energy-storage device, thereby siphoning a relatively constant (and maximum) current from the USB port. U1 (MAX4173), U2 (MAX6129), and the load-switch configuration (P1, N1, R2, and C4) form a control loop that limits the current flowing through P1. The circuit maximizes current flowing to the energy-storage element (Figure 3) by ensuring that the sum of battery and essential-circuitry currents never exceeds the maximum allowed for a USB high-power device (500mA).
To reconfigure the circuit for USB low-power operation (100mA max), you can replace U1 with a MAX4173HEUT (a device with 100V/V gain) and R1 with a 250mΩ resistor.