Hello there,
I'm planning to embed an Android phone in a box and control some LEDs with it, so my idea is to simply use an Arduino hooked up to the phone via USB and control the LEDs through a serial console or similar. In a standalone configuration, the phone would supply power to the Arduino and LEDs.
However it's unpractical to remove the phone from the box just to charge or debug it, so I thought about adding another USB socket on the outside of the box to charge and debug the Android phone.
I'm not sure whether this is even possible at all (USB host / peripheral conflict) and how to "switch" the power source from the phone to the external port. I'd be glad if somebody could point me to some resources or give me a few pointers how to go about this.
The Android phone features an USB-C socket which might be a problem too.
I've attached a schematic to illustrate the three modes of operation.
Thanks in advance for any help
