1 Replies - 541 Views - Last Post: 19 December 2017 - 02:25 AM

#1 Jakkatak   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-December 17

Can I drive a voltage output on the D+/D- lines of USB communication

Posted 18 December 2017 - 08:03 PM

Hi all,

I'm new to this forum and this is my first post. I've been trying to solve a problem I'm having with a personal project of mine but I've never programmed on Android before (or any phone) and I'm struggling to understand if my requirements are even possible; that's where I'm hoping some of the great men and women on this forum can help me :)

I'm using a SAMSUNG Galaxy S7 (although I don't believe the phone itself should matter, suffice to assume it's a modern android) and I've built my own modified USB OTG(OnTheGo) cable so that the phone can deliver power to an external device. For example, let's say I'm powering an LED in some external circuitry (I'm an electrical engineer).
What I am trying to do is use the phone to enable/disable the external device, preferably via an app on the phone. For my purposes, the circuitry must be enabled or disabled via user input on the phone.

I've tried googling how USB Serial communication works, and I have learned that the D+/D- wires are often pulled to specific voltage levels for certain chargers. Compatible phones will recognise these specific voltage levels and negotiate to receive higher voltage or current than normal to enable fast charging. What I haven't been able to determine if you can drive the D+/D- wires from the phone to certain voltage levels (e.g. digital HIGH or LOW) to drive external circuitry via an electrical switch.
It is also important to me that this occurs through Serial communication; not wirelessly, bluetooth or via the audio jack.

If anyone could please help and identify a way to specify a DC output on either of the D+/D- USB communication wires I would greatly appreciate it :)

Is This A Good Question/Topic? 0
  • +

Replies To: Can I drive a voltage output on the D+/D- lines of USB communication

#2 Radius Nightly   User is offline

  • D.I.C Regular

Reputation: 33
  • View blog
  • Posts: 291
  • Joined: 07-May 15

Re: Can I drive a voltage output on the D+/D- lines of USB communication

Posted 19 December 2017 - 02:25 AM

Enabling/Disabling USB ports on stock Android are not possible. You can use probably this with some battery charger controller (TP4056, ADP3301ARZ, 2N7002PW, MAX1551, LTC4056/7, MCP73831/2...).
And i dont think its possible to change power delivery from your phone too. It deploy at start 8mA-100mA, 3.1V, later its up to 1A-3A depending on battery (but OTG are limited to 450mA-700mA, usually limit are ~500mA), with around 3.3V-5.25V, as much as its needed from device you are powering.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1