Today, almost all computers contain logic blocks for implementing a USB port. A USB port, in practice, is capable of delivering more than 100 mA of continuous current at 5V to the peripherals that are connected to the bus. So a USB port can be used, without any trouble, for powering 5V DC operated tiny electronic gadgets. Nowadays, many handheld devices (for instance, portable reading lamps) utilise this facility of the USB port to recharge their built-in battery pack with the help of an internal circuitry.
Usually 5V DC, 100mA current is required to satisfy the input power demand. Fig. 1 shows the circuit of a versatile USB power socket that safely converts the 12V battery voltage into stable 5V. This circuit makes it possible to power/recharge any USB power-operated device, using in-dash board cigar lighter socket of your car. The DC supply available from the cigar lighter socket is fed to an adjustable, three-pin regulator LM317L (IC1). Capacitor C1 buffers any disorder in the input supply.
Resistors R1 and R2 regulate the output of IC1 to steady 5V, which is available at the ‘A’ type female USB socket. Red LED1 indicates the output status and zener diode ZD1 acts as a protector against high voltage. Assemble the circuit on a general-purpose PCB and enclose in a slim plastic cabinet along with the indicator and USB socket. While wiring the USB outlet, ensure correct polarity of the supply. For interconnection between the cigar plug pin and the device, use a long coil cord as shown in Fig. 2. Pin configuration of LM317L is shown in Fig. 3.
author: EFY Mag
circuit from http://www.extremecircuits.net/2010/05/usb-power-socket-with-indicator.html