[Q] How to hack a single micro usb for charging and data transfer at same time - Hardware Hacking General

Hello guys, I'm trying to interface android tab with peripherals. Problem is, it is having only one micro USB port which is used for charging and otg/host, only one function is possible at a time .But I need to charge the tab and simultaneously transfer data to peripherals, say for example I need to use external mouse and charge the tab at same time.
So, is there any way to do it?
I know usb has 4 pins 5v,d+,d-,gnd. I thought to wire charging input power to tab pin 5v and gnd and pin D+,D-of tab to mouse D+, D- and giving external power supply to 5v and gnd pin of mouse.
Is this a right method? To charge and transfer the data at the same time?
Kindly help me. Suggest a better way to do it.

(mini & micro) USB connectors have 5 pins: Vbus, D-, D+, Id, Gnd.
For OTG, the Id pin is connected to Gnd.
It's like the old adage, "You can lead a horse to water, but you can't make him drink."
You can connect a peripheral to an OTG host and have it work fine.
You can then connect an external power supply across the Vbus and Gnd.
The problem is, how does your host device know that it can "drink"?
There are basically two ways.
If the host detects power on its input before it switches into OTG host mode it may continue to charge.
If the host is in OTG host mode, device-specific commands to the charging circuits may convince it to charge.
There may also be non-standard Id resistor values for signalling host & charge for some devices.

I think your mileage would vary very much depending on what devices your using. AOS was not meant to deal with people hacking on the USB port, and probably the code to implement those features depend on your HW/FW.
If its a Samsung, you can play with some resistor values like these:
http://forum.xda-developers.com/showpost.php?p=25532839&postcount=2
I think the USB "CarKit" specifications should allow you both to charge and "connect" in some way.
A more easy solution would be to use a BlueTooth mouse and keep charging as usual.

Related

USB Charger cable ID pin resistor - need help from someone with a multimeter

Hey guys,
As we know Atom doesn't charge with other chargers while it's on, unless you hack a cable to connect miniusb ID pin to gnd.
I've lost my charger. Does anybody know or can test to see the resistance value of the ID pin? Some call it 'pin 4' on mini-usb, but actually it doesn't have a number and the next pin is numbered 4
The ID pin may be directly connected to GND, or may have a resistor between gnd. I need to know it to make/find a more original-like cable.
Also, does anybody know how HP rw68xx handles this with a charger with unpluggable usb cable? Does it require using a special cable with modified mini usb socket for wall charger? Cause there is no equivalent pin for the ID pin, on a standard usb socket, so probably there is no identification function on the charger.
Edit:
I'll try to locate a working cable / usb-miniusb adapter on dealextreme, if you know a specific item which should work, that would be even better.
Thanks

What's the differences between OTG cable and the one that comes with the Nexus 7?

Sent from my Nexus 7 using xda premium
An OTG cable is not for charging/connecting your device to a computer. Instead of usb micro to a male usb, it's micro to female usb, so you can plug in peripherals and flash drives etc. to your device.
Sent from my SGH-I777 using xda premium
When a normal USB is plugged in, the Nexus is in "slave" mode. Receives instructions.
When an OTG cable is plugged it allows it to be in "master" mode. Can give instructions.
Sent from my Nexus 7
Stop... MUFFIN TIME!!!
There are basically 3 types of cables you can plug into the USB port of a Nexus 7:
1. A normal USB-to-microUSB cable, plugged into a computer or a USB charger. Either way it charges, and if it is hooked to a computer the N7 is in Client Mode and you can transfer files as well.
2. High-current chargers (like the one that comes with the Nexus 7). The data lines on these are shorted together; this tells the Nexus to accept higher current on the power lines for faster charging.
3. OTG cables have the normal 4 wires on the USB end - two for power, two for data - but on the microUSB end there is a fifth connection called USBID. Normally (as when using a normal 4-wire USB cable) the USBID pin is floating, i.e. not hooked to anything. On an OTG cable, the USBID pin is connected to the ground wire. This tells the N7 that an OTG device is plugged in, which causes it to do two things: it reverses the current on the power lines - because it needs to power whatever you have plugged into the OTG cable, like a USB card reader or keyboard - and it switches the USB interface from Client Mode (which it uses when it is plugged into a computer, because in that instance the N7 is a peripheral device) to Host Mode (because in that instance the OTG device is the peripheral and the N7 is the 'computer').
There is one other option for charging: the pogo pins on the side. (The 4 pins are 5V, stereo left, stereo right, and ground.) Providing power to the pogo pins (as when it is put in a dock) tells the N7 to accept high current on the pogo pins. Momentarily connecting 5V to the right stereo channel tells the N7 that external speakers are connected and it starts driving audio out the two center pogo pins. When this is happening the charging takes place through the dock, the USB connector can be used with a data cable or an OTG device, but no charging takes place through USB when the dock is connected. (An OTG device is still powered by the N7, but current never goes the other way.)
Mechanio said:
There are basically 3 types of cables you can plug into the USB port of a Nexus 7:
1. A normal USB-to-microUSB cable, plugged into a computer or a USB charger. Either way it charges, and if it is hooked to a computer the N7 is in Client Mode and you can transfer files as well.
2. High-current chargers (like the one that comes with the Nexus 7). The data lines on these are shorted together; this tells the Nexus to accept higher current on the power lines for faster charging.
3. OTG cables have the normal 4 wires on the USB end - two for power, two for data - but on the microUSB end there is a fifth connection called USBID. Normally (as when using a normal 4-wire USB cable) the USBID pin is floating, i.e. not hooked to anything. On an OTG cable, the USBID pin is connected to the ground wire. This tells the N7 that an OTG device is plugged in, which causes it to do two things: it reverses the current on the power lines - because it needs to power whatever you have plugged into the OTG cable, like a USB card reader or keyboard - and it switches the USB interface from Client Mode (which it uses when it is plugged into a computer, because in that instance the N7 is a peripheral device) to Host Mode (because in that instance the OTG device is the peripheral and the N7 is the 'computer').
There is one other option for charging: the pogo pins on the side. (The 4 pins are 5V, stereo left, stereo right, and ground.) Providing power to the pogo pins (as when it is put in a dock) tells the N7 to accept high current on the pogo pins. Momentarily connecting 5V to the right stereo channel tells the N7 that external speakers are connected and it starts driving audio out the two center pogo pins. When this is happening the charging takes place through the dock, the USB connector can be used with a data cable or an OTG device, but no charging takes place through USB when the dock is connected. (An OTG device is still powered by the N7, but current never goes the other way.)
Click to expand...
Click to collapse
Dont forget a "y cable", which can charge and preform host mode (otg) at the same time, only at a slower charging rate. This is providing you are using a kernel that supports this function. "Otg+host mode charging"
Sent from my Nexus 7 using xda premium

diy mircousb hub

hi folks,
i would to like to build a micro usb hub.
e.g. 1 male connector and 2 female connector.
does anybody have experience in micro usb to stabilize the voltage and current?
thanx
KindsKoPP said:
hi folks,
i would to like to build a micro usb hub.
e.g. 1 male connector and 2 female connector.
does anybody have experience in micro usb to stabilize the voltage and current?
thanx
Click to expand...
Click to collapse
That would be interesting to see, I think your gonna need drivers for that as well because your gonna need a switch to cycle back and forth on what connector your using, and thats gonna be hard to do from scratch. I was contemplating doing something similar to that but wound up at a dead end. If you figure it out let me know.
it won´t need a driver. i want to build as a host hub. but the current is too low i think, so it is difficult to stabilizise the current,,
mbm262 said:
That would be interesting to see, I think your gonna need drivers for that as well because your gonna need a switch to cycle back and forth on what connector your using, and thats gonna be hard to do from scratch. I was contemplating doing something similar to that but wound up at a dead end. If you figure it out let me know.
Click to expand...
Click to collapse
It's not a question of stabilizing the current.
It's supposed to be 5 volts throughout the USB spec.
If you are using a cell phone as the host, that already produces regulated 5 volts through a charge pump.
The amount of current out of a cell phone is maybe around 100 mA.
That's what you have to work with.
If it's not sufficient for what you want then you need an external power source, not a regulator.
Hubs can be power hogs.
The spec says that a hub can take up to 100 mA all by itself.
To make a micro USB you can either take an existing hub and change the connectors.
Of course since the PCB pattern will not match up you'd have to wire the connectors in discreetly.
If you really wanted to make a real job out of this, buy a hub IC for $3,
lay out a PCB, slap on a 24 MHz crystal and connectors.
???
the idea is to build an mobile hub for tablets or smartphones for plugin external devices like sd card reader or usb stick and
mouse and keybord. hub will stick in a phone and plug in the external devices. i already had tried with a keyboard and mouse with standard usb and it works. i had already build some devices with micro usb connector. so i would like to use all devices at the same time and outdoor. i try to solve the idea without a lot of adapter..
if the usb give all devices 5v and 100mA at the same time, that would be great, without an additional IC power supplier..
thats all
i found out thats not possible to use more than 2 gadgets at the same time cause of the voltage without an external power supplier. keyboard and mice work at the same time but i f u want to plug in a 3rd gadget then wont work. 1 solution could be a mobile battery with 5v connecting with the hub. or make a built in battery in the hub..
@ renate. maybe u have an suggestion?
I have a jig for measuring current consumed by USB peripherals: http://forum.xda-developers.com/showpost.php?p=30668417&postcount=26
I use USB with only low power things like a keyboard or else
with a powered hub (also back-powering the Android).
The second option is more like a docking station.
KindsKoPP said:
hi folks,
i would to like to build a micro usb hub.
e.g. 1 male connector and 2 female connector.
does anybody have experience in micro usb to stabilize the voltage and current?
thanx
Click to expand...
Click to collapse
The 2 female connectors don't make much sense i think, because:
I can't think of any device you would like to connect with your phone as host that has a µusb connector..? You would need 2 additional OTG-cables in almost all cases
You would need OTG capability for security reasons: Imagine you hub is pluggend in you phone and you connect you computer to the hub too -> Data crash + 2 power sources in parallel -> risk of damage
I would use a normal tiny usb hub and only change the cable
u did not read my post above attentively or?
quote:
i had already build some devices with micro usb connector. so i would like to use all devices at the same time and outdoor. i try to solve the idea without a lot of adapter..
and the gadget are already automatically OTG. I already thought all about that before!
-schumi- said:
The 2 female connectors don't make much sense i think, because:
I can't think of any device you would like to connect with your phone as host that has a µusb connector..? You would need 2 additional OTG-cables in almost all cases
You would need OTG capability for security reasons: Imagine you hub is pluggend in you phone and you connect you computer to the hub too -> Data crash + 2 power sources in parallel -> risk of damage
I would use a normal tiny usb hub and only change the cable
Click to expand...
Click to collapse

How to attach usb powered hub to android stick? Which port

I have an andrid. Stick mx2 imito and I have a powered USB hub but I can't configure how I am meant to to get it to read from the hub. I have 2 ports on the stick, one full sized usb and one mini usb .
And In terms of devices I have my keyboard I want to add
1 external usb hard drive
And if I can get it to work a USB wifi dongle
Huh!
Since there is only one full sized USB port, I would think that is the solution. That's how it runs on mine anyway. Connect all your devices to the powered hub. Should be straight forward
So I would need a usb cable male to make? To connect to the hub. Do they exist ? I will try find the cable .
i cantget it to work
so the large usb port. i need a cable from that to connect to the hub? usb port
but i dont have a usb port with the same end? male to male etc
Get a USB powered hib
wakkaday said:
i cantget it to work
so the large usb port. i need a cable from that to connect to the hub? usb port
but i dont have a usb port with the same end? male to male etc
Click to expand...
Click to collapse
The hub will come with one male USB to connect to the stick.
http://gadgets.softpedia.com/images/news/How-to-Charge-your-USB-Devices-Quick-and-Easy-4.jpg
Make sure to get a powered hub so that all the devices can be supported properly.
gsurath said:
The hub will come with one male USB to connect to the stick.
http://gadgets.softpedia.com/images/news/How-to-Charge-your-USB-Devices-Quick-and-Easy-4.jpg
Make sure to get a powered hub so that all the devices can be supported properly.
Click to expand...
Click to collapse
this was an old hub i had, i dont have that wire. its a mini usb to full usb type connection isn't it?
Plenty of such options available
Here is another on ebay. Just search for powered USB hub and choose one
http://www.ebay.com/itm/10-PORT-USB-2-0-EXTERNAL-HUB-W-POWER-ADAPTER-FOR-PC-MAC-WITH-cable-SILVER-/370772094009?pt=US_USB_Cables_Hubs_Adapters&hash=item5653bd2c39
gsurath said:
Here is another on ebay. Just search for powered USB hub and choose one
http://www.ebay.com/itm/10-PORT-USB-2-0-EXTERNAL-HUB-W-POWER-ADAPTER-FOR-PC-MAC-WITH-cable-SILVER-/370772094009?pt=US_USB_Cables_Hubs_Adapters&hash=item5653bd2c39
Click to expand...
Click to collapse
ok great, so the port next to the power socket, is the cable i need to attach to and from the imito android stick? so that will be the main one and any other usb devices can go on the hub.
m confused on where i need to connect from on the android stick. which has 1 full sized usb, 1 mini usb otg socket and 1 mini usb (power)
It should also be possible to modify a USB hub to back feed power to the HDMI stick.
You would then power the hub with a sufficiently large USB power supply to power both the stick and all of the USB devices. In most cases, a single 2.1 Amp USB "wall wart" would work to power everything, unless you are really running something outrageous.
My NX003 (Same as MX1) can be powered from either the dedicated USB power jack, or the MicroUSB (OTG) connector.
So to build something like this, here is what I would do:
1. Obtain a USB hub I was willing to modify (destroy, as far as any other use is concerned)
2. Disassemble it.
3. Remove the input (Host) cable or connector.
4. Attach a short cable with a MicroUSB plug. Connect all 4 wires correctly.
5. Find "The diode" - Buy "The diode" I mean the one that that allows USB power to flow from the host to the peripherals when used in non-powered mode, but prevents power from flowing upstream to the host when an external power supply is used. (see referenced link).
6. Remove this diode, and replace it with a wire, jumper, or solder bridge.
7. Ensure all power circuity in the hub can handle 2 amps. Add solder to traces, or add jumper wire if needed to beef up current capability.
8. Reassemble, and clearly mark so that this hub is never used with anything else.
If the HDMI stick were powered via a coaxial connection, but is still powered by 5 Volts, I'd add a lead and coaxial plug off of the +5 in the hub. you'll have 2 wires, but it will still work. (Watch polarity.)
I have done this successfully for a prior, similar project. Reference Here: (Scroll to section about power.)
http://linuxslate.com/N770DockingStation.html
So why don't I actually do this to power my NX003? I did it an easier way. I bought a Tronsmart Prometheus. It has 3 full USB ports built-in.
-
Linuxslate said:
It should also be possible to modify a USB hub to back feed power to the HDMI stick.
You would then power the hub with a sufficiently large USB power supply to power both the stick and all of the USB devices. In most cases, a single 2.1 Amp USB "wall wart" would work to power everything, unless you are really running something outrageous.
My NX003 (Same as MX1) can be powered from either the dedicated USB power jack, or the MicroUSB (OTG) connector.
So to build something like this, here is what I would do:
1. Obtain a USB hub I was willing to modify (destroy, as far as any other use is concerned)
2. Disassemble it.
3. Remove the input (Host) cable or connector.
4. Attach a short cable with a MicroUSB plug. Connect all 4 wires correctly.
5. Find "The diode" - Buy "The diode" I mean the one that that allows USB power to flow from the host to the peripherals when used in non-powered mode, but prevents power from flowing upstream to the host when an external power supply is used. (see referenced link).
6. Remove this diode, and replace it with a wire, jumper, or solder bridge.
7. Ensure all power circuity in the hub can handle 2 amps. Add solder to traces, or add jumper wire if needed to beef up current capability.
8. Reassemble, and clearly mark so that this hub is never used with anything else.
If the HDMI stick were powered via a coaxial connection, but is still powered by 5 Volts, I'd add a lead and coaxial plug off of the +5 in the hub. you'll have 2 wires, but it will still work. (Watch polarity.)
I have done this successfully for a prior, similar project. Reference Here: (Scroll to section about power.)
http://linuxslate.com/N770DockingStation.html
So why don't I actually do this to power my NX003? I did it an easier way. I bought a Tronsmart Prometheus. It has 3 full USB ports built-in.
-
Click to expand...
Click to collapse
Thank you for the informatiom, but its a bit too technical for what i want... but i appreciate you efforts in writing this.
my stick can also power via both usb ports (mini) i have connected the cable from the stick to the hub which has been powered to the mains and it works, but the problem i have is when i put another usb device in the hub, it doesnt detect it e.g. keyboard wireless and i don't think the device has enough power to run my usb 2.0 portable harddrive (not main powered) - how can i get this to work? i have tried connecting this directly to the stick, but it just makes a beep sound. im guessing its lack of power... and i was hoping a hub would help.
my hub is powered 3.5 or 4 watts i believe...
Strange
Wakkaday,
This is very strange. On my MK802III I connect the powered USB hub (4 ports) to the full USB port.
I connect my bluetooth keyboard, 1 TB HDD and USB ethernet to the hub.
I power my Android stick using the 4rth port in the USB hub.
If I want USB audio, I replace the Ethernet/HDD with a USB audio peripheral.
All my peripherals work right out of the box. The only thing I am considering now is to have a separate power supply to the Android stick so that I can use all 4 ports on my hub.
It seems your device is not supporting the peripherals? Are the working when you connect directly?
gsurath said:
Wakkaday,
This is very strange. On my MK802III I connect the powered USB hub (4 ports) to the full USB port.
I connect my bluetooth keyboard, 1 TB HDD and USB ethernet to the hub.
I power my Android stick using the 4rth port in the USB hub.
If I want USB audio, I replace the Ethernet/HDD with a USB audio peripheral.
All my peripherals work right out of the box. The only thing I am considering now is to have a separate power supply to the Android stick so that I can use all 4 ports on my hub.
It seems your device is not supporting the peripherals? Are the working when you connect directly?
Click to expand...
Click to collapse
I'm also trying to use a powered 4 port usb hub with my android stick, but it doesnot recognises the hub. Do i need to have any usb host drivers or change any setting to get it work? My stick is on Android ICS.. Thanks in advance

SM-T510 Tab A 2019 10.1 Otg with charge and data?

Hello guys,
Does anyone knows if there is a otg cable/hub that can power the tablet and be able to use data like usb connected at the same time?
Thanks
The 2019 tablet does not need this, since the port is USB type C albeit USB 2.0; I have connected mine to a hub and have pass-through charging and data. OTG is not really a thing any more since USB type C came about.
Prostheta said:
The 2019 tablet does not need this, since the port is USB type C albeit USB 2.0; I have connected mine to a hub and have pass-through charging and data. OTG is not really a thing any more since USB type C came about.
Click to expand...
Click to collapse
Can you share the type of hub you have been used?
Is the charging speed fine?
Kingston Nucleum. This tablet is in my car and the hub receives power from a 12-14v converter providing USB C PD and USB 3.0 fast charge. Ultimately, the hub defaults charging voltage to that of the lowest device connected. In my case a Sandisk SSD and a Meizu HiFi DAC Pro. This generally means that charging is slow, however it depends on your configuration. I'd say that the charging speed is fine, however it only charges when the car is running or in accessory mode and the tablet is always on in that state. As such the excess power it uses to charge whilst running is only a little more than it uses. It might charge faster if I power the hub from the USB C PD port, however I don't know if this is just pure amps or whether it negotiates higher charging voltages. I don't know if the Nucleum hub allows negotiation of higher charging voltages.
Prostheta said:
Kingston Nucleum. This tablet is in my car and the hub receives power from a 12-14v converter providing USB C PD and USB 3.0 fast charge. Ultimately, the hub defaults charging voltage to that of the lowest device connected. In my case a Sandisk SSD and a Meizu HiFi DAC Pro. This generally means that charging is slow, however it depends on your configuration. I'd say that the charging speed is fine, however it only charges when the car is running or in accessory mode and the tablet is always on in that state. As such the excess power it uses to charge whilst running is only a little more than it uses. It might charge faster if I power the hub from the USB C PD port, however I don't know if this is just pure amps or whether it negotiates higher charging voltages. I don't know if the Nucleum hub allows negotiation of higher charging voltages.
Click to expand...
Click to collapse
Nice, i'm using for the same purpose.
In my dash car
I'm also using MacroDroid for automation.
My issue right now is how should i leave the tablet when i turn ignition off.
I Think i will just shut it down, but i don't like to wait 30 seconds to but again when i turn it on.
What do you do in your case?
I'll have to check out MacroDroid. I'm currently set up with AutoMate, however there's a few annoyances which I think need ironing out. Vanilla Android Auto might not be the most exciting, but it's certainly the most friendly for driving safety.
I leave my tablet as-is. AutoMate automatically wakes the tablet into car mode on USB power and goes to sleep when it loses that. My car (Chrysler 300C) has accessory power for 30s (I think I can increase this in the EVIC) after the ignition is turned off which keeps the charger energised, and by extension the tablet. I'm not too bothered about having to boot up the tablet if it does discharge its battery to shutdown. I think it's maybe a week or so for it to do that, likely less when the tablet ages. As long as it charges and runs on the supply happily I think we're good. In that instance, I might have to see whether an auxiliary power bank would be a workable option. Not at this stage though. Bear in mind that most modern car head units still take about the same amount of time to boot as an Android tablet anyway.
I'm having minor USB issues myself, however this is down to the cable I need not being available. A lot of USB C "charging" cables are only pinned for power and not data. This might be part of any USB C issues you might be having. I myself need a USB C male with a tight 90° or 180° turn, out to a USB C female for the hub's pigtail. I might have to make the choice to fabricobble myself a USB cable just for this purpose....
This is a photo of the install, prior to me wrapping it in 3M brushed black steel vinyl.
I'm updating all of my comments in various threads on this. My setup with the Kingston Nucleum hubis having minor issues. The tablet still needs to be powered up before I turn on the car or at least supply power to the hub. It seems that if this is done the other way around, that is, to power on the car accessories (and hence the hub) then it seems to end up staying as the "device in charge" of the USB network. The tablet charges (slowly) but doesn't mount the USB SSD drive or the USB DAC. If the tablet is powering the hub (in charge, so to speak) then applying power to the hub via the car accessory supply has it working as expected. This does mean that the tablet ends up with a power drain when the car/USB power supply is powered down which isn't ideal. I've gotten into the habit of turning the tablet off when I park for long periods of time, however I need to boot it up to "take charge" of the USB hub network before I can start the car. It's a bit of a bummer.
I'm unsure whether this is a tablet hardware/software issue, the hub or whatever. Going into Android settings and trying to alter the default USB behaviour returns the message that it "cannot switch roles" or something along those lines. I'm beginning to think that this might be the USB hub refusing to switch/relinquish power supply roles once it has external power and hence not allowing the tablet to mount drives or see connected USB devices. It's weird behaviour, because you'd imagine that if the hub were connected to a laptop this would be a common action.
If it helps, I've read that OTG function is not included by Samsung for their device's USB ports. I've been trying to connect some together to perform file transfers with no success. However, I have been able to transfer and charge simultaneously between my SM-T510 tablet and PCs with the USB configuration set to file transfer.
Prostheta said:
The 2019 tablet does not need this, since the port is USB type C albeit USB 2.0; I have connected mine to a hub and have pass-through charging and data. OTG is not really a thing any more since USB type C came about.
Click to expand...
Click to collapse
How to transfare Battery power from Tab to another Android device?

Categories

Resources