Author Topic: Android and USB microcontroller as peripheral  (Read 487 times)

0 Members and 1 Guest are viewing this topic.

Offline sledTopic starter

  • Contributor
  • Posts: 21
  • Country: ch
Android and USB microcontroller as peripheral
« on: August 28, 2019, 11:08:17 am »
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 :)
 

Online coromonadalix

  • Super Contributor
  • ***
  • Posts: 6651
  • Country: ca
Re: Android and USB microcontroller as peripheral
« Reply #1 on: August 28, 2019, 02:18:57 pm »
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: us
Re: Android and USB microcontroller as peripheral
« Reply #2 on: August 28, 2019, 03:21:16 pm »
There are 'Y' cables which allow power/charge in one end and USB OTG in the other coming from a phone/tablet.

Bigger question here is what is the phone doing that the arduino can't?  Why not eliminate the phone and make the arduino do what you want.
 
The following users thanked this post: 001

Offline jmpowell

  • Newbie
  • Posts: 5
  • Country: us
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf