Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

USB Diverter

Status
Not open for further replies.

D@rkL0rd

Member
Hey everyone,

So I undertook a project on which I would like some help.

I want to create a device that will divert a USB channel from one port to another. A crude representation of what I am trying to achieve. (Basic Structure.png)

So far I have created this circuit (Primary Circuit.jpg).

R1 is used to bring the base current down. I have yet to find its value.
B1 is one of the buttons showed on Basic Structure photo.
X1, X2, X3, X4 are the transistors used as a switch. I am not sure that this will work but this is what I could come up with.

I did not complete the second part to avoid confusion but think it will be same as the others.

The first thing I want to know is if this is even possible? Am I on wild goose chase?
If this is possible then will my circuit be able to achieve it or do I have to make other arrangements?

Thank You for you time.

Primary Circuit
Primary Circuit.jpg

Basic Structure
Basic Structure.png
 
JimB I saw that before trying to make it. But I wanted to make one on my own. :p

Ramussons I think 4 pole 2-way switch would be a right choice. I will create a temp circuit and post here.
 
Nigel Goodwin
Yes, there's no point in reinventing the wheel but I just wanted to get started in on electronics and I thought it would be a nice and easy start.

Also, as I am a beginner I need to make every circuit from scratch. I don't have enough experience but I am hoping to get some.
Do you think quad bilateral switches like CD4066 or CD4016 would be a better choice here?
Thanks.
 
You can of course just put a simple four pole switch and the job is done.

However, you also need to consider what happens when the operating system in the computer which does not have the keyboard connected, detects that and decides that something is very wrong.

By using a KVM switch, each computer sees a keyboard, but data is only sent to the one which you select.

Try the simple switch, if it does what you want, that is good.
But be prepared for problems.
The quick answer to those problems is a KVM switch.
Building a true USB KVM switch is not a trivial task.

JimB
 
JimB what could the OS do when it detects that the keyboard is not connected.

I think I will first try the normal switch then see what problems it is throwing

And yes now it is dawning upon me that it is not as easy as thought it would be. But I am gonna try to build it.

Thanks.
 
Okay guys, I am back after my exams and all ready for completing this project. I am sorry for not coming back after for so long.

So does anybody know any good simulator that I can use to simulate the CD4066?

I have tried 123circuits.com and fritzing simulator.

Thanks.
 
The 4066 may work for D+ and D- switching, but not the 5V switching, which would need big FETs or a relay. No need to switch GND.
 
Will the 4066's lower ON Resistance be a problem? I can use the 4016 as it has higher ON Resistance.

Also can you tell me some simulator that I can test 4016 and 4066 on. I can't seem to find any.

Thanks
 
You want the lowest possible ON resistance. The 4066 may be just good enough for the data lines, not for switching the 5V

There is a third-party model for the '4066 available for LTSpice.
 
@MikeMI Okay, so I can use the 4066 on the data lines. How do I the power lines? Should I use an external power adaptor or is there any dirty work around with USB's power lines.
 
To save you time, I attached the model 4066 I usually use (as *.sub and *.asy). Perhaps there are other models of it on internet.

Edited:
It is for LTspice
 

Attachments

  • CD4066.zip
    1.1 KB · Views: 119
About the 5V supply, you may try this test.
Perhaps your keyboard may work on 5V - Vd (Vd is the diode drop voltage). In case it works fine, the solution for the 5V supply would be very simple. You will need just two diodes (selected having the lowest drop); one for each computer. Their common cathode will then supply the keyboard.
 
Kerim MikeMl I was thinking. Do I need to switch the +5V too? I mean can't I keep it connected like the GND. As both of the +5V lines will be in parallel to the keyboard's +5V line, I don't think it should be a problem. So we keep the don't switch the +5V and the GND line and just switch the data lines.
Thanks.
 
Or if we definitely need to switch the +5V lines then we use a simple toggle switch as it is nothing but a simple power line. And further, use the same switch with a resistor in series as the control switch in the 4066 which is switching the data lines.

We will need the resistor because the control voltage needs to be between 1-3.5 and the power lines will be working at 5V

Thanks.
 
If you are going to use a mechanical switch, why not just get one with at least three poles?
 
MikeMl yeah, at first I thought of doing so. But then I thought that it would be a crude way and that using an IC might be better. I think I will use a 3DPDT switch.

Also can you please explain to me again what problems might appear if I switch the +5V line using the 4066. I don't think I understood it :p.

Thanks.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top