0
\$\begingroup\$

I want to ask if it's possible and an advice on how to make an automatic distinction between an PC-USB port and Wall-USB adapter. I've a battery charger IC (for example http://www.mouser.com/ds/2/405/bq24074-556796.pdf) where I can set max. IN current. I have no problems to set it to 500mA, but I'll always charge the battery at 500mA in PC and Wall-Adapter. But I want to charge the battery at 1-1.5A when I connect it to Wall-Adapter and when I connect it to a PC I don't want to fry PC usb port and charge battery at 500mA. Something like in a smartphone. I thought about sending some data via usb to know if it's an PC or Adapter but I need something more safety and always working.

\$\endgroup\$
  • 1
    \$\begingroup\$ You can't check for a short between D+ and D- like everyone else? \$\endgroup\$ – Ignacio Vazquez-Abrams Jun 11 '15 at 17:20
  • 1
    \$\begingroup\$ You can get ICs which do all of the detection for you and then switch the USB D+/D- lines through to the rest of your device. MAX14578 is one. \$\endgroup\$ – brhans Jun 11 '15 at 17:32
0
\$\begingroup\$

There are two main ways that USB high current is indicated (Apple's way and everyone else.)

Apple uses a resistor divider to set D+ and D- at various voltages to indicate between 500mA and near 2A charge. 1.1 and 1.5A I think in there. I would have to think if this puts a kink to below if you use an Apple charger.

Everyone else shorts D+ and D- together. Many USB charge controllers handle the detection on the USB data lines. If you are making a one of device, that is an easier route.

For your own detection, tie D+ to VCC with 10k resistor. Tie D- to GND with 100k resistor. Read D-, if high you can pull high current. If low, you can't.

For your Mouser linked chip: Pull EN2 low with 10k resistor. Connect D- to EN1 to enable full current if data lines shorted or 100mA if not.

\$\endgroup\$
  • \$\begingroup\$ The Apple chargers use 50k ~ 75k resistors to pull the datalines to 2V ~ 3V depending on current and series, in most cases that I remember. So a 100k pull-down might not have a high enough EN voltage any more. The chip does also say it has a 285kOhm pull-down to GND close to where it says to always connect them, so... bit confusing there. \$\endgroup\$ – Asmyldof Jun 11 '15 at 19:19
  • \$\begingroup\$ Yes, I was looking at using a common charger, rather than Apple's own standard. \$\endgroup\$ – Joe Jun 22 '15 at 22:48
  • \$\begingroup\$ I was just making the point, because the OP names no brands at all. But it'll work for most, if not all non-Apples that I know of. \$\endgroup\$ – Asmyldof Jun 22 '15 at 22:59

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.