0
\$\begingroup\$

Question: How can I build or buy a USB cable (or hub or adapter or anything) that will limit the charging current to the minimum (0.1A I believe) without obstructing the data lines which would break adb?

Scenario/use case: As I'm certain people will ask, here's why I need it. I am doing Android debugging and have my phone connected to my computer all day. I don't want to charge the device above 80%, so the bare minimum charge current would be ideal (or if possible, no charging at all, although my research thus far has indicated that may not be possible because the minimum current is negotiated entirely in hardware between the computer and the mobile device). My phone is not rooted and I would prefer not to on this phone, so I can't use the device-side control. I can't use wifi debugging because the computer is not on the wifi network (and can't be).

\$\endgroup\$
2
  • 1
    \$\begingroup\$ This will likely require a hub, because power negotiation happens between each device and the hub it is plugged into. If the "root hub" in your computer tells the phone that 500mA or 900mA is available, the phone will try to use it. An intermediate hub can indicate that only 100mA is available. (Can and often does -- a bus-powered hub typically asks for 500mA from the root hub and then tells each device to use only 100mA, so that the total over four ports doesn't exceed the 500mA) \$\endgroup\$
    – Ben Voigt
    Jun 7, 2023 at 17:15
  • 1
    \$\begingroup\$ @BenVoigt this sounds acceptable; consider moving this comment to an answer \$\endgroup\$ Jun 22, 2023 at 14:54

1 Answer 1

0
\$\begingroup\$

That isn't possible.

Any normal USB device needs power supply to communicate. Which basically means for any normal USB such as MicroUSB, a device can keep the USB interface turned off until 5V is detected from PC.

And then it can use the 5V supply. And if you try to limit it or turn it off, the device does not need to work without 5V supply as it must turn the interface off. Limiting it means it will drop or turn off when too much is consumed.

You likely want this because you have read somewhere that charging batteries to only 80% full will make them last longer.

That is true; however, you cannot know what capacity battery your phone really has by design and how much capacity the phone is made to use from it. It may very well be that when phone shows 100%, the battery is not really charged to full capacity.

The battery could likely hold some more charge but it is left as a margin to take into account how much the battery degrades and ages depending on how full it is charged, so the phone manufacturer has already done the difficult task of determining how much of the battery capacity will be used so it lasts long enough. Basically same as with EVs, whatever amount of capacity the batteries really have, only the specified amount of capacity is presented for the user as 0% and 100%, so that after the batteries have degraded due to years of use and charging/discharging cycles, the rated user visible capacity is still there.

Devices and their chargers are very smart and under software control, as even the charging system behaviour can be altered by software or firmware update.

I don't think you will have any benefit of trying to limit the charging to 80% yourself, as it basically means disconnecting USB supply and it means USB communication also stops.

So just let the phone to charge itself so that it presents 100% to you and stops charging, the battery is likely rated to handle it, and will continue to use USB power until you disconnect it.

\$\endgroup\$
4
  • \$\begingroup\$ Given that the question allows "a cable or adapter or hub", yes it is possible to limit charging current to 100mA which is what OP actually asked for. That may not keep the battery down at 80%. \$\endgroup\$
    – Ben Voigt
    Jun 7, 2023 at 17:16
  • 1
    \$\begingroup\$ @BenVoigt The problem is USB enumeration. The phone communicates with host and request how much it would like to have current. The host can then either allow it (it can get whatever it asked) or not (process won't continue and phone will not be allowed to take the current it requested). So you can't limit the current to phone, you can't communicate to the phone that no matter how much it requested, only 100mA is available, and host also can't say to the phone to stop charging when 80% full. \$\endgroup\$
    – Justme
    Jun 7, 2023 at 17:22
  • 1
    \$\begingroup\$ The decision to grant the requested current or not is made by the directly connected hub, which is not necessarily the host root hub. And a device that's denied the current it first requested can request again with a lower current (smart devices like phones will, otherwise they couldn't connect to e.g. laptops) \$\endgroup\$
    – Ben Voigt
    Jun 7, 2023 at 17:48
  • \$\begingroup\$ I would love if the manufacturers tuned the battery charging, but looking at the incentives they have reason not to. Longer battery is highly desired for marketing and getting contracts, and if the batteries die early death they sell more batteries. If they did the "right" thing, pretty much nobody would even know. So there is heavy incentive for them not to optimize them. A car maker like Tesla is a much different story, as early failuires would be very damaging to them. Why are we assuming the phone makers do optimize them given the incentive? \$\endgroup\$ Jun 12, 2023 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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