Maker Pro
Maker Pro

Beginner Question...

Ledbetter14

Jun 9, 2016
16
Joined
Jun 9, 2016
Messages
16
Hi guys, I'm new to all of this so bear with me:). I am looking to add IR control to a USB switch I have by way of GPIO pins on a Raspberry Pi. I am fine with the IR/GPIO side, what I need help with is selecting the right components to do the switching.

My USB switch is entirely mechanical and closes all four wires of the USB to a common output one at a time. So my plan is to remove the mechanical switch entirely and bridge the contacts with ??? so that I can close it with the 3.3V from the GPIOs.

Any advice??
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
I'm assuming what you're calling an existing switches to be electromechanical relays.
I don't think anyone can answer your question accurately without knowing what devices you intend to switch on and off.

Chris

Edit: I may have totally misinterpreted your question, which is why we speak schematic here. It helps greatly reduce confusion. ;)
 

Ledbetter14

Jun 9, 2016
16
Joined
Jun 9, 2016
Messages
16
image.jpeg image.jpeg image.jpeg image.jpeg
I'm assuming what you're calling an existing switches to be electromechanical relays.
I don't think anyone can answer your question accurately without knowing what devices you intend to switch on and off.

Chris
This is the switch, the devices I will be switching are just general peripherals, no storage devices or similar that would require great care
.image.jpegimage.jpeg
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Yup, I misinterpreted your post. I did edit my post before seeing your reply though. How about a simple schematic or block diagram depicting what you want to do?

Chris
 

Ledbetter14

Jun 9, 2016
16
Joined
Jun 9, 2016
Messages
16
like I said, very new to this :) but keen to learn. Enjoy my hand drawn block diagram (Any pointer to a good schematic/drawing utility would also be helpful :)
)image.jpeg
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Not elegant but would 4 Pole micro-relays work for you?

Chris
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Your schematic implies that you're only interested in switching the 5V pin. Is this correct?

Chris
 

Ledbetter14

Jun 9, 2016
16
Joined
Jun 9, 2016
Messages
16
Your schematic implies that you're only interested in switching the 5V pin. Is this correct?

Chris
If that is an acceptable solution, could I then just hard wire the remains three pins to the output with the 5v pins controlling which port is active? Otherwise I will switch all four if needed.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
If that is an acceptable solution, could I then just hard wire the remains three pins to the output with the 5v pins controlling which port is active? Otherwise I will switch all four if needed.

My wife is watching a Netflix movie right now and I think my online pipeline sharing is giving her fits. Our broadband isn't that broad, so this will be my last post until her movie is over.

Anyway, no.. You have to duplicate switching all the pins that the switch does. USB can't have more than one device per port without a hub of some sort.

Regarding Schematic Editor Software:
Google LT Spice from Linear Technologies and Tina - TI found at the Texas Instruments website. They're both free.

Chris
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Are you going to be switching only a single USB device on and off as indicated in your schematic?

Chris
 

Ledbetter14

Jun 9, 2016
16
Joined
Jun 9, 2016
Messages
16
Are you going to be switching only a single USB device on and off as indicated in your schematic?

Chris
No, it will be four to a common output. Essentially I will code it to turn all off then close the appropriate switch through individual GPIO pins. My diagram was a bit rushed.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Please forgive me as I forgot something important right from the get-go...
Welcome to EP!

OK, your last sketch and description makes things much clearer now. It's now time for this old dog to hit the sack but I'll pick this back up over morning coffee.

Ciao
Chris
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
USB ports consists of 4 conductors.
Pin1: +5V
Pin2: Data-
Pin3: Data+
Pin4: GND

After examining your photos of the USB switch board these are my observations:
(1) All 4 pins are switched including the GND pin.
(2) The switch board employs a transfer bar that releases any previously pressed
switch prior to closing the contacts of the switch currently being pressed.
(3) The switch board is intended to switch between 4 host computers and a
single USB client device.
(4) The switch board is not intended to switch a single host computer between
4 different client devices. This assumption was made by observing the types
of connectors used on the board. I could be wrong so member feedback would
be appreciated.

Before tearing into that board there may be an off the shelf inexpensive alternative. Perhaps another member has a link. I did search ebay for relay boards and USB switching devices but didn't score on a proper hit.

Since you want to re-purpose the switch board you will have to be a proficient solderer. Removing components, especially components like these switches can damage the traces badly unless your experienced doing it.

A really low grade option that would leave this board electrically intact would be four small (push action) solenoids that would replace your finger pressing the switches.

I also pondered the use of AND Gates but this wouldn't handle the +5V or GND pins.

I do think that 4 miniature 4pole 5V relays would work fine though. You appear to have plenty of real estate to retrofit them to the board.

Anyone out there have any input on this topic, like a 100% solid state solution or an off the shelf relay board?

Chris
 
Last edited:

Ledbetter14

Jun 9, 2016
16
Joined
Jun 9, 2016
Messages
16
I just got an ebay hit on this USB SwitchBox.
Is this your product?

Chris
Yes that is the product. The intention here is to have a single USB port in my home theatre room from an externally located media cupboard. Then using the switch I will via IR choose which device is connected to that point.

The micro relay solution makes sense to me given my low level of comprehension of these circuits. In short the coil of the relay would energise and pull in with 3.3V, bridging the contacts? The GPIO can only output 50mA, is this sufficient or achievable with a transistor?
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
It may not be easy to find a 4 Pole relay with a 5V coil. I didn't find any on ebay or www.mpja.com where I can usually find items at a great price. 12V models are plentiful
though. The coil voltage and current isn't going to be a big deal because you can power it from an inexpensive wallwart. Most of us have copious quantities of them procured over the years.

Yes, the coils won't be driven directly from your GPIO pins. The GPIO pins will drive the base of a small NPN transistor with the coil wired in the Collector circuit. I will draw the schematic for you.

In the interim see if you can find any 5V 4PST relays. You'll need 4 of them. Odds are you may find 5V or 12V models in 4PDT versions. These will work. You simply won't be using one of the contacts on each relay.

Anyone have a source down under for our new member???

Chris
 
Top