Author Topic: Normally on electronic switch  (Read 1092 times)

0 Members and 1 Guest are viewing this topic.

Offline gaminnTopic starter

  • Frequent Contributor
  • **
  • Posts: 343
  • Country: 00
Normally on electronic switch
« on: August 14, 2019, 08:20:02 am »
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.
 

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9821
  • Country: 00
  • Display aficionado
Re: Normally on electronic switch
« Reply #1 on: August 14, 2019, 08:29:50 am »
I'm still not sure what you want to use the switch for. Switch the inputs? Maybe you'd want to look at how something like an Arduino switches between USB and external power.
 

Online Berni

  • Super Contributor
  • ***
  • Posts: 5050
  • Country: si
Re: Normally on electronic switch
« Reply #2 on: August 14, 2019, 08:34:15 am »
Things like a JFET or depletion mode MOSFET are conducting when there is no voltage on the gate but stop conducting once voltage is applied. Tho you might need negative voltages to make it work.
 

Offline gaminnTopic starter

  • Frequent Contributor
  • **
  • Posts: 343
  • Country: 00
Re: Normally on electronic switch
« Reply #3 on: August 14, 2019, 08:39:13 am »
I'm still not sure what you want to use the switch for. Switch the inputs? Maybe you'd want to look at how something like an Arduino switches between USB and external power.

I want to switch ID pin (it is one pin of USB connector) to:

1) when there is no power, it is connected to ground.
2) when there is power, there is a resistor connected between ID pin and ground.

There is MCU in my device, so the switch will be controlled by MCU.
 

Offline gaminnTopic starter

  • Frequent Contributor
  • **
  • Posts: 343
  • Country: 00
Re: Normally on electronic switch
« Reply #4 on: August 14, 2019, 08:41:40 am »
Things like a JFET or depletion mode MOSFET are conducting when there is no voltage on the gate but stop conducting once voltage is applied. Tho you might need negative voltages to make it work.

I found JFETs that have like 30 ohms rdson, which is more than what I expect from "connected to ground". And also the negative voltage means I have to solder another IC on the board. But yes, it is the best solution I have at the moment.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3279
  • Country: us
Re: Normally on electronic switch
« Reply #5 on: August 14, 2019, 09:01:22 am »
Use a 3-pin DC jack such as this:

810636-0

Pin 1 is the center pin which will be connected to the positive supply; pin 2 is connected to GND. With nothing plugged in pins 2 and 3 are connected, but with a plug inserted they are disconnected.

Connect pin 3 to the USB ID pin; also connect a 10K resistor in parallel (from the USB ID to GND).

When the external plug is not inserted the USB ID pin and GND will be shorted.

When the external plug is inserted the resistance between the USB ID pin and GND will be 10K.
 

Online Berni

  • Super Contributor
  • ***
  • Posts: 5050
  • Country: si
Re: Normally on electronic switch
« Reply #6 on: August 14, 2019, 10:08:01 am »
I found JFETs that have like 30 ohms rdson, which is more than what I expect from "connected to ground". And also the negative voltage means I have to solder another IC on the board. But yes, it is the best solution I have at the moment.

You can get power switching depletion MOSFETs that have a on resistance of under 1 Ohm, but since this is just a signal pretty sure 30 Ohm would be just fine too. The phone is likely not measuring the resistance on the ID pin with much current behind it, so it would make sense to have the threshold quite a bit higher than a few ohms since you wouldn't want a handful of milivoltes of voltage to trip it.

As for negative voltage you can build a charge pump with your existing MCU, so no extra IC is needed.
 

Offline gaminnTopic starter

  • Frequent Contributor
  • **
  • Posts: 343
  • Country: 00
Re: Normally on electronic switch
« Reply #7 on: August 14, 2019, 11:14:48 am »
Use a 3-pin DC jack such as this:

Great idea. The only drawback I can see - when there is power outage or user leaves jack connected to the device without connecting adapter to AC power socket, the device will not work.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6420
  • Country: de
Re: Normally on electronic switch
« Reply #8 on: August 14, 2019, 07:45:05 pm »
Use a SPDT reed relay.

 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17427
  • Country: us
  • DavidH
Re: Normally on electronic switch
« Reply #9 on: August 14, 2019, 08:46:03 pm »
A JFET or depletion mode MOSFET would be my first choice.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf