Hi,
I have an USB device that will be connected to a smartphone. The device can be powered by a smartphone (OTG) and there is also jack connector to supply external power to the device.
The ID pin of USB cable will be controlled by the USB device to tell the smartphone whether it should supply USB power or not.
Normally, when the device is without power, the ID pin must be shorted to ground. So, when the device is connected to the smartphone it gets 5V.
Also, there can be external power connected to the device. In this situation, the device will short the ID pin to ground with e.g. 10 kOhm resistor. This will tell the smartphone, when the device is connected to it, that it should not supply 5V to the USB, instead, it can charge from 5 V supplied by the device.
So, I'm looking for a switch that is normally (without any power) shorted to ground, but when there is a power, it can be controlled (to connect some resistor to ground).
I don't want to use mechanical relay.