Charge Android device by connecting it to a reader (external device) via USB.

  • 02 July 2019
Post image

This is a bit of a digression from the topic of software, but there are times when you want to use a USB hub or something to increase the number of ports when connecting to a device via USB from an application (iOS or Android smartphone app).

In this case, I needed to develop an application to connect an Android tablet to a reader (felica, etc.) via USB while charging it.

A normal phone or tablet would have only one USB or Lightning port. Therefore, they would use a hub from the device to add more terminals.

I’m going to write about it below, because I got into trouble, even though it seems to be a normal thing to be able to connect external devices with usb while charging, and this kind of information can be found on the net. There was a problem that existed before the application development.


USB hub has host and client.

First, I tried connecting the tablet to an external reader with a regular USB hub, but it did not charge the battery.

USB hubs are supposed to branch off the USB port of the source (host), and it seems that the destination (client) cannot exchange data with each other.

In the above example, power is supplied to each, but the tablet and the external device cannot be connected via USB.

The fact that client ports cannot be connected to each other, and that the hub has one host port and multiple client ports.


Can’t connect USB to external devices while charging your phone or tablet?

Another fact is that a normal USB hub supplies power to the client device, but not to the host.

In other words, a normal USB hub cannot supply power to the host (tablet). (Cannot charge)

Why can’t such a simple configuration be done! I have no idea. If the phone or tablet had a charging method other than a USB port, it wouldn’t be a problem even if the USB port didn’t supply power.


Some USB hubs are PD (Power Delivery) compatible.

Defined in 2015 as an additional specification for USB 3.1, it can provide up to 100W of power at 20V/5A, compared to 4.5W for the previous USB bus power and up to 7.5W for the USB BC (Battery Charging) specification.

http://e-words.jp/w/USB_PD.html

I honestly don’t know, but a PD (Power Delivery) compatible USB hub means that it is a type of hub that also supplies power to the source of the connection.

And it seems that this PD requires a type-c connector. I’m embarrassed to say that I didn’t know that there was a USB-PD standard in the world.

The following configuration is for the USB-PD hub.


PD-compatible smartphone and tablet devices

But by the way. I heard that there are USB-PD compatible smartphones and tablets. If you don’t have one, even if you buy a USB-PD compatible hub, it won’t charge the USB host port.

The following iOS devices are USB-PD compatible. (See Apple’s official page for details)

  • iPhone 8 or later
  • iPad Pro

There are a few Android devices that support USB-PD.

If you don’t have one of these devices, you won’t be able to charge it through the USB hub host connection while charging. In fact, the slightly older tablet I tried was not charged when connected to the USB hub host and an AC adapter was attached to the hub.


summary

In order to connect a smartphone/tablet to an external device via USB and charge them at the same time, the following two conditions must be met.

  • PD-compatible smartphones and tablets
  • USB-PD compatible hub (AC adapter can be connected)

If you are using a Bluetooth connection between your phone/tablet and an external device, each device can be charged on its own, but if you prefer a USB connection, please refer to the above.

(Article migrated from another blog)

You May Also Like