geekhack

geekhack Projects => Making Stuff Together! => Topic started by: shadowku on Thu, 08 February 2018, 23:43:20

Title: Need Help - USB Switch button replacement
Post by: shadowku on Thu, 08 February 2018, 23:43:20
So I bought a 4-port USB switch (http://meowhttps://www.amazon.com/UGREEN-Selector-Computers-Peripheral-One-Button/dp/B01MXXQKGM/ref=sr_1_1_sspa?ie=UTF8&qid=1518153754&sr=8-1-spons&keywords=ugreen+usb+switch&psc=1) from Amazon but I don't like the form factor.

I plan to put the hub into a box (http://www.ikea.com/ca/en/catalog/products/30198028/) that I bought from Ikea, but I need to change the button.

After opening it up, soldered onto the board I found something like this:
(https://www.mouser.in/images/microsites/e-switch%20tl3305%20tactile%20switch%20pic.png)

Would it be possible to desolder it and then add something like this:
(https://cdn.sparkfun.com//assets/parts/2/8/8/9/09336-1.jpg)
?

I'm not very familiar with switches and the like. Ideally I'd actually rather replace the e-switch with a toggle switch (http://www.partdeal.com/media/catalog/product/cache/1/image/1200x1200/4105104eb37814677cb2026494ac36bd/5/5/55015-03.jpg).

Thanks!
Title: Re: Need Help - USB Switch button replacement
Post by: suicidal_orange on Fri, 09 February 2018, 00:50:58
Those little switches are momentary which means they only connect (or disconnect) the circuit while the button is pressed, you'll need to find out which it is by testing continuity.  If it's default to disconnected (most common) you can add a second switch without removing the first which would be easier for a beginner.

Think of the 4 legs as two wires running down the sides of the switch and test between the two using a simple battery and LED circuit or a multimeter if you have one

You can certainly find a suitable switch similar to the red button one but specs of the switch and the result of the test above are needed to confirm it will work rather than a picture :)

Assuming the e-switch is a typo (I'm awake early and shouldn't be so brain not fully functional)  and you're talking about the same switch a toggle won't work as toggles change the connected state semi permanently which is not what the device expects.   You can get momentary switches that look like toggles but spring back to the default position if it's just the appearance you like...
Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Fri, 09 February 2018, 08:51:28
Those little switches are momentary which means they only connect (or disconnect) the circuit while the button is pressed, you'll need to find out which it is by testing continuity.  If it's default to disconnected (most common) you can add a second switch without removing the first which would be easier for a beginner.

Think of the 4 legs as two wires running down the sides of the switch and test between the two using a simple battery and LED circuit or a multimeter if you have one

You can certainly find a suitable switch similar to the red button one but specs of the switch and the result of the test above are needed to confirm it will work rather than a picture :)

Assuming the e-switch is a typo (I'm awake early and shouldn't be so brain not fully functional)  and you're talking about the same switch a toggle won't work as toggles change the connected state semi permanently which is not what the device expects.   You can get momentary switches that look like toggles but spring back to the default position if it's just the appearance you like...

Thanks for the reply.
I actually thought these little switches (the one I found on the board) is called an e-switch but it's likely that I'm wrong.

Is the red button in my opening post also a momentary switch? I'm not sure how many legs it has, but it may be 3 or 4. Is the red button also a momentary switch? 
Pressing the switch on the circuit changes the state of the board, toggling it between output 1&2. I do have a multimeter so I'll test it out tonight. What should I be looking for?

I haven't soldered since highschool (which I did a lot of) but the easiest approach would definitely be best for me. If I could add a second switch, that'd be best.
Title: Re: Need Help - USB Switch button replacement
Post by: suicidal_orange on Fri, 09 February 2018, 10:15:39
You need to check how the current switch works, not how the device it's attached to reacts when it's pressed - see test in previous post.  It might be a toggle switch, if it is alternate presses will sound different and it will retain continuity after one press but not after two.  If it's always the same it's either NO (normally open, no continuity) or NC (normally connected, continuity unless pressed)

The red button also looks like a momentary switch but that would only need two pins (either they are connected or not) but it could also act as a toggle as above but connecting pins 1-2 or 2-3 alternately.  No way to tell by looking at the pretty front!
Title: Re: Need Help - USB Switch button replacement
Post by: Questengine on Fri, 09 February 2018, 12:42:07
You need to test the old switch like suicidal_orange says, but I've used buttons like the red one in arcade controllers and can confirm that the red Happ (or Happ-like) button and microswitch does accommodate both NC and NO configurations.  You can almost see the imprints of NC and NO on the green plastic in the photo you posted. If the old switch is a toggle that maintains it's state when not pressed, like a light switch, then the Happ cannot replicate that functionality.
Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Fri, 09 February 2018, 13:06:51
Thanks guys!

I think I know what I have to do when I get home now. Just have to find my voltmeter.
Hopefully it works out.

Any recommendations for places to buy buttons/switches?
Title: Re: Need Help - USB Switch button replacement
Post by: ErgoMacros on Fri, 09 February 2018, 14:34:08
Mouser, Digikey, Jameco, Fry's Electronics, even hardware stores or Home Depot... especially for a toggle switch.
Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Sat, 10 February 2018, 00:52:10
Good news everyone! Testing with a voltmeter shows that the switch is a momentary switch.

At least, assuming that the legs of the switch actually come in pairs, the switch only seems to have continuity when pressed down (disconnected by default, connected when pressed).

I guess I can now buy a momentary switch and give this a try.

Thanks!

Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Wed, 14 February 2018, 21:28:41
Just wondering actually, is it possible to configure or wire up a toggle switch as a momentary switch?
Title: Re: Need Help - USB Switch button replacement
Post by: BlindAssassin111 on Wed, 14 February 2018, 21:36:34
Just wondering actually, is it possible to configure or wire up a toggle switch as a momentary switch?

Momentary toggles do exist. You will notice them as they will have parenthesis around the state, which means momentary. ex (ON) OFF (ON) where OFF is the center position and the default and therefore not momentary so it isn't in parenthesis, but the two ON states are. You can have some switches be (ON) OFF ON as well, so only one is momentary and the other isn't.

Just look it up on amazon or ebay, they cost almost nothing. I have some that cost $1 each and are pretty good quality.
Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Thu, 15 February 2018, 08:25:20
Momentary toggles do exist. You will notice them as they will have parenthesis around the state, which means momentary. ex (ON) OFF (ON) where OFF is the center position and the default and therefore not momentary so it isn't in parenthesis, but the two ON states are. You can have some switches be (ON) OFF ON as well, so only one is momentary and the other isn't.

Just look it up on amazon or ebay, they cost almost nothing. I have some that cost $1 each and are pretty good quality.

Awesome! Thanks for telling me about that. I think that's perfect for my project since flicking a switch feels better than hitting a button since it'll be at the back of my table.
Is something like this (https://www.amazon.com/Podoy-Toggle-Switch-Switch-Waterproof/dp/B077T5TRF3/ref=sr_1_18?ie=UTF8&qid=1518704657&sr=8-18&keywords=momentary+toggle) what you're talking about?
Title: Re: Need Help - USB Switch button replacement
Post by: BlindAssassin111 on Thu, 15 February 2018, 10:39:14
Awesome! Thanks for telling me about that. I think that's perfect for my project since flicking a switch feels better than hitting a button since it'll be at the back of my table.
Is something like this (https://www.amazon.com/Podoy-Toggle-Switch-Switch-Waterproof/dp/B077T5TRF3/ref=sr_1_18?ie=UTF8&qid=1518704657&sr=8-18&keywords=momentary+toggle) what you're talking about?

No, that toggle is still a latching one, so it wouldn't do what you want. This would though, https://www.amazon.com/gp/product/B00TGO9MAU/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B00TGO9MAU/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1)
Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Thu, 15 February 2018, 10:56:26
No, that toggle is still a latching one, so it wouldn't do what you want. This would though, https://www.amazon.com/gp/product/B00TGO9MAU/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B00TGO9MAU/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1)

Ah, I see what you mean now. Thanks!
Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Thu, 15 February 2018, 12:16:22
No, that toggle is still a latching one, so it wouldn't do what you want. This would though, https://www.amazon.com/gp/product/B00TGO9MAU/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B00TGO9MAU/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1)

Sorry, one more question.
I'm noticing that different places describe the products differently so I'm a bit confused.. but is this (https://www.homedepot.ca/en/home/p.toggle-spdt-20a-125vac-ofo-1cd.1000104180.html) a (ON)-OFF-(ON) switch? If so, then I can get this locally.
Thanks!
Title: Re: Need Help - USB Switch button replacement
Post by: BlindAssassin111 on Thu, 15 February 2018, 12:34:56
Sorry, one more question.
I'm noticing that different places describe the products differently so I'm a bit confused.. but is this (https://www.homedepot.ca/en/home/p.toggle-spdt-20a-125vac-ofo-1cd.1000104180.html) a (ON)-OFF-(ON) switch? If so, then I can get this locally.
Thanks!

That is not sadly. If you scroll to the description you can see it is listed as ON-OFF-ON, and that it is used on industrial lighting, so it is definitely a latching toggle. You will always see the parenthesis on momentary switches as that is the industry symbol for that, if you don't and are unsure, look at a different one to be safe.
Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Thu, 15 February 2018, 13:08:47
That is not sadly. If you scroll to the description you can see it is listed as ON-OFF-ON, and that it is used on industrial lighting, so it is definitely a latching toggle. You will always see the parenthesis on momentary switches as that is the industry symbol for that, if you don't and are unsure, look at a different one to be safe.

Ah okay. I'll get a switch that explicitly says it's momentary.
Title: Re: Need Help - USB Switch button replacement
Post by: suicidal_orange on Fri, 16 February 2018, 02:32:26
Is there any reason you're now looking at a 2 way switch?  The original you're looking to replace is just an OFF-(ON)

You could wire both sides of an (ON)-OFF-(ON) the same so you can knock it either way which would be an acceptable answer, but usually it's best to use the simplest part that works :)
Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Fri, 16 February 2018, 05:33:43
Is there any reason you're now looking at a 2 way switch?  The original you're looking to replace is just an OFF-(ON)

You could wire both sides of an (ON)-OFF-(ON) the same so you can knock it either way which would be an acceptable answer, but usually it's best to use the simplest part that works :)

It's really just form factor. I was originally planning on following a guide (http://www.instructables.com/id/Usb-Switch/) to build a USB switch with a 4dpdt switch. The issue is that I wouldn't be able to have more than 2 USB inputs but I want the possibility of connecting a numpad in addition to a keyboard and a mouse. The two guides I was looking at both use a toggle switch and I like the idea of physically flicking something to change the output source.

Another reason is the Ikea box (http://www.ikea.com/ca/en/catalog/products/30198028/) that I am going to house this project in. I'm going to be putting this on the corner of my pretty large desk and route the wires out of it to keep things tidy. The button that I linked in my opening post would have been on one of the sides of the box, but as a button, each time I press it, the box will be pushed back a bit unless I weigh the box down. I fancy the idea of flicking a switch as I'll either have to flick it up/down (I am planning to wire both momentary ONs) which would make it less likely that the box will be moved.

I still think a button isn't bad, but since I already bought the box, I think a switch is more ideal for how I want to use it. If not, I was also considering using the Novel Keys Big Switch (https://www.novelkeys.xyz/product/the-big-switch-series/) but it's a little late for that and I don't think it would look as elegant.

Title: Re: Need Help - USB Switch button replacement
Post by: suicidal_orange on Fri, 16 February 2018, 05:49:20
That's an interesting way of doing a USB switch, not surprised the guy had problems when there were unshielded untwisted pairs in the middle of his cable (at the switch) though!

I'd probably have gone for a low profile button on the top of the box but it's personal preference and if being able to flick it two ways to simulate a toggle works for you that's the right option :thumb:
Title: Re: Need Help - USB Switch button replacement
Post by: shadowku on Wed, 28 February 2018, 23:40:48
I finished my switch box! Thanks everyone for your help.
Behold! (https://imgur.com/a/UA7ee)
Title: Re: Need Help - USB Switch button replacement
Post by: suicidal_orange on Wed, 07 March 2018, 02:22:10
Looking good!

How is it working out now you've had a while to play with it?