0
\$\begingroup\$

I have an Allview tablet running Android I want to connect to my board using USB. An application on the Android tablet would control the micro which in turn would control a bunch of relays and read from a bunch of sensors.

I have routed the +5V, GND, USB_ID and USB_DATA1/2 pins to a connector but I am not sure how to set up the pins on this micro USB connector so that the tablet can talk with my micro and also charge its battery from my board.

Some people say it's going to work with an OTG adapter, which basically pulls down the sense pin to GND. But how does the tablet charge its battery? The connection will be long term/permanent so the tablet needs power.

I have seen a lot of tutorials and specs out there but they are convoluted bricks of text with a lot of ifs and buts so I still don't quite understand: Do I pull down the USB_ID/sense pin to GND? If that's the case my understanding is the tablet would supply power to the board which I don't want, I want the tablet to charge from the board because it will run out of battery eventually.

The board can and must supply some 500mA at +5V to the tablet using the micro USB connector.

Would appreciate some tips from someone more experienced with the USB bus architecture.

\$\endgroup\$
3
  • \$\begingroup\$ Slightly different question. With the Allview tablet were you able to enable adb \$\endgroup\$ Sep 17, 2020 at 11:15
  • \$\begingroup\$ I'm not sure what that is but the manufacturer indicated an OTG cable must be used. Which is alright except still no option to power the tablet. \$\endgroup\$
    – Nick M
    Sep 17, 2020 at 11:18
  • \$\begingroup\$ Adb - Android debugging Bridge. Some android tablets like Samsung Tables have Security software that prevents activating the adb . Thus I was just wondering. Note adb is activated via the USB port. \$\endgroup\$ Sep 17, 2020 at 11:24

1 Answer 1

3
\$\begingroup\$

USB / USB OTG doesn't give you much of an option here – the device never powers the host, so you can't charge your tablet while it's the host to an OTG device – at least as long as the tablet behaves standards-compliant (and I'd argue doing that here would be a very good idea, because drawing power from a device sounds like a very bad idea if the device doesn't want to be a charger, as it can damage the device.)

So, I don't see a way to do what you want.

\$\endgroup\$
13
  • \$\begingroup\$ so how does it work when you hook up a phone/tablet to a computer and it charges at the same time with loading stuff? \$\endgroup\$
    – Nick M
    Sep 17, 2020 at 12:06
  • 1
    \$\begingroup\$ then the tablet is the device, and the computer is the host. \$\endgroup\$ Sep 17, 2020 at 12:07
  • \$\begingroup\$ is there anything stopping my pic32 from operating in the same way? \$\endgroup\$
    – Nick M
    Sep 17, 2020 at 12:11
  • 1
    \$\begingroup\$ Yes. You need your PIC32 to be the device, functionally. So it can't be the host. End of story, really. \$\endgroup\$ Sep 17, 2020 at 12:12
  • 1
    \$\begingroup\$ TL;DR: doesn't work like you want it to. Your tablet needs to be host. Your pic needs to be device. Devices can't charge hosts. We're turning in circles. \$\endgroup\$ Sep 17, 2020 at 12:31

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.