I recently made a USB charger that takes a 9V battery. I've noticed it doesn't work with a lot of devices though. It was very simple though, just a 5volt regulator hooked to a USB plug and 9V battery and a switch.

Note: I'm wanting to use what I have on hand(all sorts of capacitors, resistors, and 5v regulators) so the minty boost is out of the question(requires some components I don't have any of, such as inductors)

So what did I do wrong? I just shorted together the data+/- pins(bad idea now that I've thought about it). Should I have these hooked to something or just left unhooked? Also, should I worry about installing a 500mA PTC fuse? And lastly do I need any kind of capacitors to handle any rippling and such?

  • 1
    \$\begingroup\$ A linear regulator wastes 44% of battery energy. Consider using a lower voltage battery (pack), such as 4-5 AA's, and/or a switching regulator. There are even some 7805 pin-compatible packages (3-SIP): goo.gl/ly5bw . \$\endgroup\$ – tyblu Dec 11 '10 at 1:28
  • \$\begingroup\$ @tyb yea, I'm using a simple linear regulator right now. I'm going to be ordering some of these( sparkfun.com/products/317 ) soon though. \$\endgroup\$ – Earlz Dec 11 '10 at 6:06

I just shorted together the data+/- pins(bad idea now that I've thought about it).

Nope. That's the standard, actually. The official USB Battery Charging v1.2 Spec is almost completely unreadable, but it does say:

A Dedicated Charging Port (DCP) is a downstream port on a device that outputs power through a USB connector, but is not capable of enumerating a downstream device. ... A DCP shall short the D+ line to the D- line.

The the current is literally limited by the charger. There is no negotiation of what the device is allowed to draw, the charger just drops its voltage when the device tries to draw more current than it can handle. (And the device then has to lower its draw in response or the charger shuts down?)

Of course, Apple has to do it their own proprietary incompatible way for iPods and iPhones:

The mysteries of Apple device charging

The nice thing about Apple is that they tell the device how much current it's allowed to draw, and it obeys.

And the phone manufacturers had their own ways before the standard, usually using the ID pin:

USB charger specifications and compatibility list

I don't know if there's a circuit that will work with all of the above, but if you find one, let me know.

  • \$\begingroup\$ yeah, usb charging spec has a resistor between D+ and D- and devices that use it will check for it. \$\endgroup\$ – Kortuk Dec 11 '10 at 1:40
  • \$\begingroup\$ Well, they always describe it as a resistance ("RDCP_DAT" = "Dedicated Charging Port resistance across D+/-"), but then the spec for that variable is, I think, anything less than 200 ohms, including a short. \$\endgroup\$ – endolith Dec 11 '10 at 1:50
  • \$\begingroup\$ Yes, the element actually checks for the voltage swing, when pushing a current, being below a certain voltage. \$\endgroup\$ – Kortuk Dec 11 '10 at 2:59

What devices are you charging?

Latest generation iPod touches and their ilk require some resistors on the data lines; apparently to detect if the charger is an authorised Apple one.


It's pretty simple - just 4 resistors.

Don't worry about the PTC. Most linear regulators have thermal limiting and current limiting. It's pretty difficult to damage a properly designed linear regulator.

Remember with a linear regulator excess energy is dissipated as heat. Power dissipation in a linear regulator is (Vin - Vout) x Iout. So for 0.5A out, 9V in and 5V out, the regulator is dissipating 2W and providing 2.5W to the device; 4.5W in total, with an efficiency of about 55%, which is pretty poor. But, it may be fine for your application.

Almost all linear regulators require small decoupling capacitors. It varies from regulator to regulator. Most require 100n caps on input and output, but some require larger bulk decoupling. Specifying exactly which regulator you are using would help.

  • \$\begingroup\$ +1 Mintyboost. If you're eligible, sample an LT1302 from Linear. Then the cost is very cheap. \$\endgroup\$ – user1307 Dec 11 '10 at 2:52
  • \$\begingroup\$ I'm just glad I don't have to worry about iPod charging. I'm mainly just concerned about cellphones(non-iPhone). Also this is my regulator: docs.google.com/… \$\endgroup\$ – Earlz Dec 11 '10 at 6:02

I am going to link you to an answer I wrote with respect to the USB charging spec. I hope it can be of help.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.