USB OTG pin 4 toogle on charge

userHead Malloth Christoph 2015-03-03 02:01:16 3369 Views4 Replies
Hi there,

I have the following problem:

I want to supply power to the Bluno from my Andoird tablet.
This can be done from USB OTG specification by connceting pin 4 and pin 5 of the micro USB together.
The annoying thing is that by connecting these pins together you could not charge
anymore when connecting +5V on pin 1 and GND on pin 5.

The idea is that if you attach a power supply (+5V and GND) to pin 1 and 5 for charging,
there is no need that the Android tablet is supplying current to the Bluno. While
charging the Bluno can be supplied by the charger.

So I have only to detect if the power supply is attached to the configuration or not and
dependent on the situation to ground pin 4 or not or to connect it to the pin 5 or not.

But that is actually my problem as I am more a computer science enginneer than an
electrical engineer.

Is there perhaps even a way to toogle pin 4 from software?

I could imagine a solution where you take the +5V line coming from the charger
to toggle a relay or a transistor before going to the input pins
of the Bluno and the tablet. In order that the tablet
will not supply current of itself to this toogle set, there could be a diode in order to
block the current from the tablet to this toggle set.

Any help would be welcome.

2015-03-10 10:26:45 hi Malloth,

1 I thought you could write the kernel code of the android, it seems hard to get it.

2 your idea gave me some inspiration that why not design a circuit to use a triode or MOSFET as a switch between Pin4 and GND, depending on whether the power was supplied. :geek:
userHeadPic Leff
2015-03-07 01:51:13 Hi Jeff,
Thanks for your thoughts. Here some thoughts of mine:
1.) how to change from software the pin 4 state
(my tablets are rooted and if you find a convenient kernel for a U25GT cube tablet Android 4.4.x
I would recompile it)
2.) The problem is like "how was first the egg or the chicken":
I have to find out, if the 5V to the Bluno is coming from the power supply
or from the tablet in order to ground the Pin 4 or not.
I tried with a diode to block current coming from the tablet but the voltage
drop over the diode from the power to supply to the tablet makes that this
smaller voltage/current pair does not charge the tablet anymore.

Any other hints to find out from where the voltage is coming from?
userHeadPic Malloth Christoph
2015-03-04 11:02:08 hi Malloth,

since now i have no idea to switch pin-connection automatically, if i was inspiration struck , i will tell you. :roll:

but you can try to read the charging state of Android tablet, if it's charging then set the PIN4=HIGH, if not, PIN4=LOW; have a try ;)
userHeadPic Leff
2015-03-03 10:12:06 hi Christoph,

i feel rather difficult to understand your trail, could you have some photo to show your idea?
userHeadPic Leff