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.