I'm making at least 4x of a project, consisting of a tablet computer (HP Stream 7) connected to a USB device (Labjack U3-LV). These will be permanently connected together in a sealed enclosure. I intend for the enclosure to have a single USB jack on the outside, to be used for external power only (never data).
When external power is present, it should power both tablet and USB device, and preferably charge the tablet. This requires the USB Sense pin to be connected to ground through a 124K resistor.
With no external power, the tablet should power the USB device from its internal battery. This requires the USB Sense pin to be grounded.
The tablet should act as a host, and be able to communicate with the Labjack, in both modes. I have tested these modes successfully, by splicing three USB cables together, then manually changing the resistance between Sense and GND.
But I need this to be automatic, and I'm not sure how to accomplish that. (EDIT: I'd prefer a solution implementable with discrete components if possible, but a specialized IC is acceptable.)
My first thought was to connect the external V+ pin to the tablet/Labjack through a Schottky diode. This would allow me to easily detect the presence of the external supply, and if I can just manage that, I can figure out the rest. However, the 2A OEM external supply drops to 4.8V when powering the tablet and Labjack. Adding in the Schottky's drop, it leaves the voltage too close to USB 2.0's minimum specified 4.4V.
Any ideas?
I could use a different supply that maintains at least 5.0V, or modify the external USB cable/supply to send a signal on one of the unused data pins to allow detection. But then my design wouldn't work if the user swapped what appears to be a standard part for a different one, so that's not acceptable.
Or I could use a barrel jack, and 5V PS with barrel plug, for external power. But then the user might plug in a higher voltage supply by mistake. So add a internal switching regulator, set for 5.3V (to allow for the Schottky drop). And another PS, instead of using the ones provided with the tablet. There's got to be a more elegant solution!
(Also, I found that the tablet will not charge its battery when the charger is connected, and the tablet is on. It will not drain the battery when on, but it only charges the battery when the tablet is off. This occurs even with the unmodified OEM charger/cable. With my modified cables and 124K resistor, the tablet additionally doesn't display that external power is present, though it otherwise functions identically. I could not resolve it through the suggestions I found via Google, of changing the screen brightness or reloading the "Microsoft ACPI Compliant Control Method Battery" driver. It would be nice, but not necessary, to fix this as well; though since the issue exists even with OEM charger/cable, I'm not sure it can be fixed.)