Author Topic: How do I make a SPDT Relay with delay using transistors  (Read 2706 times)

0 Members and 1 Guest are viewing this topic.

Offline Mikek400Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: jp
How do I make a SPDT Relay with delay using transistors
« on: February 25, 2016, 06:41:25 am »
In short, I have a logic level circuit I need to switch.
I suppose a very small SPDT relay and small 2-3 second timer would do the job but it seems like there should be an easy enough way to do this with a couple of transistors and a 555.

After getting power it needs to wait to switch for 2 or 3 seconds.

I don't know how to make this work, but would really appreciate some guidance in making a solution for this problem.

I'm just kind of starting out with building electronics, so I thought this would be a good chance to learn something.

I attached a crude schematic of the current circuit I would like to automate.



******************************************************
Long explanation for those who are interested in why.


I have a windows tablet pc that has only one micro USB port on it. It uses this port for charging as well as USB OTG to connect USB peripherals. The problem is it won't usually charge while in OTG mode. Just applying 5v to the power lines of the USB port won't make it charge.. To get it to charge, you have to short the data+/- lines together. Then as long as you keep power applied to the Power +/- lines it will continue to charge without shorting the data +/-. You can then connect usb devices to the data lines and the PC and they work.

Currently I am using a SPDT switch to accomplish this, but would like it to be automatic rather than having to flip a switch each time I plug in my tablet.

The purpose of this is so that I can charge the tablet and use USB devices at the same time. As it is now, I have to plug the usb hub in with the SPDT switch in shorted position and then flip the switch every time I connect the hub. I want to make it all automatic. It needs to have the lines shorted for a few seconds and then switch in the lines for the USB hub.

Detecting the USB plug in is easy, just use the USB shield and USB ground pin as a switch.. i.e. leave the ground wire disconnected in the USB cable. The shield wire is used to carry ground. When you plug it into the tablet pc it connects the shield to the GND wire (since they are tied together on the tablet's USB port) and completes the circuit.

Thanks in advance
« Last Edit: February 25, 2016, 06:52:45 am by Mikek400 »
 


Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19786
  • Country: gb
  • 0999
Re: How do I make a SPDT Relay with delay using transistors
« Reply #2 on: February 25, 2016, 09:12:46 am »
You can get analogue switch ICs. They're not relays, as they're not isolated and the signal being switched has to be within the IC's power supply rails but they're more compact, cheaper and solid state so there's no switch bounce and no moving parts to fail.
http://www.ti.com/lit/ds/symlink/sn74lvc1g3157-q1.pdf
http://www.ti.com/lit/ds/symlink/sn74lvc2g53.pdf

For the delay, a simple RC circuit plus Schmitt trigger IC will do.
http://www.nxp.com/documents/data_sheet/74LVC1G14.pdf

Through hole alternatives for the parts are available but they're more expensive and don't have such good specifications, see below.

http://www.nxp.com/documents/data_sheet/74HC_HCT4066.pdf - SPST but use two switches with an inverter and you might as well connect 2 in parallel for lower on resistance.
http://www.nxp.com/documents/data_sheet/74HC_HCT14.pdf
 

Offline michaeliv

  • Frequent Contributor
  • **
  • Posts: 260
Re: How do I make a SPDT Relay with delay using transistors
« Reply #3 on: February 25, 2016, 08:06:45 pm »
The problem is it won't usually charge while in OTG mode.
Some tablets charge + OTG at the same time with the following hack: http://s4.postimg.org/5boi2kdzh/Y_OTG_CABLE.png
Try different resistor values.
« Last Edit: February 25, 2016, 08:09:08 pm by michaeliv »
 

Offline Mikek400Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: jp
Re: How do I make a SPDT Relay with delay using transistors
« Reply #4 on: February 26, 2016, 01:05:57 am »
Thanks for all the replies.  :-+

Unfortunately my tablet won't charge using any OTG Charging Hubs that I have found.  It also won't charge using resistor on pin 4. Any value on this pin seems to put the tablet into OTG mode.

I think I will try building the RC circuit and see how it works. Seems like the best solution. 

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf