<p>See <em>elsewhere</em> on StackExchange:</p>

<ul>
<li><p>Electronics:</p>

<ul>
<li><a href="https://electronics.stackexchange.com/questions/34741/can-an-android-tablet-serve-as-usb-host-and-be-charged-simultaneously-through-a">Can an Android tablet serve as USB Host and be charged simultaneously through a single port?</a></li>
</ul></li>
<li><p>Android Enthusiasts</p>

<ul>
<li><p><a href="https://android.stackexchange.com/questions/34227/using-an-otg-cable-while-charging">Using an OTG cable while charging</a></p></li>
<li><p><a href="https://android.stackexchange.com/questions/28745/usb-charging-in-host-mode">USB charging in host mode [duplicate]</a></p></li>
</ul></li>
</ul>

<p>You certainly can charge whilst in host mode, but some re-wiring will be required.</p>

<p>From the SE.Electronics <a href="https://electronics.stackexchange.com/questions/34741/can-an-android-tablet-serve-as-usb-host-and-be-charged-simultaneously-through-a">link</a></p>

<blockquote>
  <p>Apparently it is possible to charge the Host-Device! -->
  <a href="http://en.wikipedia.org/wiki/USB_On-The-Go" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/USB_On-The-Go</a></p>
  
  <p>Under "OTG Micro Plugs" it says that a USB OTG cable with a 36.5 kΩ
  resistor between Pin 4 (I suppose its pin 4) and Pin 5 allows you to
  connect a B-Device (Slave) and (!) a Charger to the Smartphone/Tablet.
  The Phone and the B-Device can be supplied by the external power
  source.</p>
  
  <p>USB-Power Specifications:
  <a href="http://www.usb.org/developers/devclass_docs/batt_charging_1_1.zip" rel="nofollow noreferrer">http://www.usb.org/developers/devclass_docs/batt_charging_1_1.zip</a></p>
</blockquote>

<p>and </p>

<blockquote>
  <p>I just sifted through the docs because I didn't trust Wikipedia's implicit data on which of the three resistances I should use. Here you can find the official <code>Battery Charging v1.2 Spec and Adopters Agreement</code>: <a href="http://www.usb.org/developers/docs/devclass_docs/" rel="nofollow noreferrer">usb.org/developers/docs/devclass_docs</a> In this case you want 124kΩ, because you want the OTG device (=tablet) to be the A device (=host). </p>
</blockquote>

<p>Here are the schematics:</p>

<p><a href="https://i.sstatic.net/Uty2y.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Uty2y.jpg" alt="Post schema"></a></p>

CC BY-SA 3.0
2017-06-14T04:52:10.460Z
@Sergey - Welcome. Your app sounds interesting, btw.
Greenonline
CC BY-SA 3.0
2017-06-14T21:09:14.543Z
Note that this can be device specific.  Not all android devices implement USB OTG and charging the same way.
markshancock
CC BY-SA 3.0
2017-06-14T04:06:15.990Z
2017-06-14T04:06:15.990Z
Greenonline
<p>I am writing a G-code sender for Android, but I have hit a snag.
How can I prevent the phone from discharging while it sending G-code to the printer?</p>

<p>I have several Android phones and tablets and they have a micro USB OTG connector, which I can connect to my 3D printer using an adapter.
But it looks like OTG has this limitation - it can either accept power when in <em>Device</em> mode, or it can provide power in <em>Host</em> mode.  So, while in <em>Host</em> mode the phone can't be charged, so I can't do long prints, which seems like an unreasonable limitation.  </p>

<p>Any ideas on how to solve this?</p>

CC BY-SA 3.0
2017-06-13T19:33:51.360Z
This question isn't really about 3D printing. The 3D printer isn't relevant to the question, it's just a question of whether a smartphone can charge while in USB OTG mode. Moreover, the specific phone in question is probably quite important to the answer.
Tom van der Zanden
CC BY-SA 3.0
2017-06-13T21:22:30.123Z
I think this problem is specific to 3D printing, because it's a very unique use case.  3D printer must be connected to the phone for several hours.  In other use cases a person can transfer a file to a USB flash drive in just a few minutes, so a battery charging is not an issue.  Also it's not specific to the phone.  Every phone and tablet I have behaves the same for this matter.
Sergey
CC BY-SA 3.0
2017-06-13T21:47:24.503Z
The *answer* might be specific to the phone/tablet. Maybe some support it, maybe some don't,...
Tom van der Zanden
CC BY-SA 3.0
2017-06-13T23:45:30.733Z
Ah, I see.  But even if there is only one phone that "support it" - that would be a solution.  I'll just buy that exact phone.  Thanks.
Sergey
CC BY-SA 3.0
2017-06-14T21:10:32.433Z
This can be Android device specific.  Can you edit your question to list the devices you have tried this on?
markshancock
CC BY-SA 3.0
2017-06-15T22:26:50.223Z
It looks like this special cable doesn't work on any of my OTG devices: Dragon Touch Y88X Plus, LenoTab, Kindle Fire 7" model SV98LN, KOSLAM 10 inch tablet.
Sergey
CC BY-SA 3.0
2017-06-15T22:34:39.423Z
P.S. But I have heard that it works for some other devices: Samsung i9300 Galaxy S 3, Nexus 4, Nexus 5, Nexus 6, Nexus 10.  I wonder if anyone have made a complete list?  Or is there an online database of devices that implement OTG standard properly?
Sergey
<g-code>
How can I charge an Android phone while it's controlling my 3D printer?
Sergey
# How can I charge an Android phone while it's controlling my 3D printer?

(Asked by: username_0 on 2017-06-13)

I am writing a G-code sender for Android, but I have hit a snag.
How can I prevent the phone from discharging while it sending G-code to the printer?

I have several Android phones and tablets and they have a micro USB OTG connector, which I can connect to my 3D printer using an adapter.
But it looks like OTG has this limitation - it can either accept power when in *Device* mode, or it can provide power in *Host* mode. So, while in *Host* mode the phone can't be charged, so I can't do long prints, which seems like an unreasonable limitation.

Any ideas on how to solve this?

**Tags:** g-code
> **Comments:**
> **username_1**: This question isn't really about 3D printing. The 3D printer isn't relevant to the question, it's just a question of whether a smartphone can charge while in USB OTG mode. Moreover, the specific phone in question is probably quite important to the answer.  
> **username_0**: I think this problem is specific to 3D printing, because it's a very unique use case.  3D printer must be connected to the phone for several hours.  In other use cases a person can transfer a file to a USB flash drive in just a few minutes, so a battery charging is not an issue.  Also it's not specific to the phone.  Every phone and tablet I have behaves the same for this matter.  
> **username_1**: The *answer* might be specific to the phone/tablet. Maybe some support it, maybe some don't,...  
> **username_0**: Ah, I see.  But even if there is only one phone that "support it" - that would be a solution.  I'll just buy that exact phone.  Thanks.  
> **username_2**: This can be Android device specific.  Can you edit your question to list the devices you have tried this on?  
> **username_0**: It looks like this special cable doesn't work on any of my OTG devices: Dragon Touch Y88X Plus, LenoTab, Kindle Fire 7" model SV98LN, KOSLAM 10 inch tablet.  
> **username_0**: P.S. But I have heard that it works for some other devices: Samsung i9300 Galaxy S 3, Nexus 4, Nexus 5, Nexus 6, Nexus 10.  I wonder if anyone have made a complete list?  Or is there an online database of devices that implement OTG standard properly?  

---

## 1 answers

### Answer by username_3 on 2017-06-14. Score: 1 | Accepted answer

See *elsewhere* on StackExchange:

* Electronics:

  + [Can an Android tablet serve as USB Host and be charged simultaneously through a single port?](https://electronics.stackexchange.com/questions/34741/can-an-android-tablet-serve-as-usb-host-and-be-charged-simultaneously-through-a)
* Android Enthusiasts

  + [Using an OTG cable while charging](https://android.stackexchange.com/questions/34227/using-an-otg-cable-while-charging)
  + [USB charging in host mode [duplicate]](https://android.stackexchange.com/questions/28745/usb-charging-in-host-mode)

You certainly can charge whilst in host mode, but some re-wiring will be required.

From the SE.Electronics [link](https://electronics.stackexchange.com/questions/34741/can-an-android-tablet-serve-as-usb-host-and-be-charged-simultaneously-through-a)

> Apparently it is possible to charge the Host-Device! -->
> <http://en.wikipedia.org/wiki/USB_On-The-Go>
>
> Under "OTG Micro Plugs" it says that a USB OTG cable with a 36.5 kΩ
> resistor between Pin 4 (I suppose its pin 4) and Pin 5 allows you to
> connect a B-Device (Slave) and (!) a Charger to the Smartphone/Tablet.
> The Phone and the B-Device can be supplied by the external power
> source.
>
> USB-Power Specifications:
> <http://www.usb.org/developers/devclass_docs/batt_charging_1_1.zip>

and

> I just sifted through the docs because I didn't trust Wikipedia's implicit data on which of the three resistances I should use. Here you can find the official `Battery Charging v1.2 Spec and Adopters Agreement`: [usb.org/developers/docs/devclass\_docs](http://www.usb.org/developers/docs/devclass_docs/) In this case you want 124kΩ, because you want the OTG device (=tablet) to be the A device (=host).

Here are the schematics:

[![Post schema](https://i.sstatic.net/Uty2y.jpg)](https://i.sstatic.net/Uty2y.jpg)

> **Comments:**
> **username_3**: @Sergey - Welcome. Your app sounds interesting, btw.  
> **username_2**: Note that this can be device specific.  Not all android devices implement USB OTG and charging the same way.  

---

