USB Switch (3rd version)
This project involves the use of mains electricity. Do not make this unless you know what you are doing. I cannot be held responsible if you electrocute yourself, anyone else, or burn your house down.
USB switch by Jason Tribbeck is licensed under a Creative Commons Attribution 3.0 Unported License.
After a week or so of using it, I came to the computer after it had been turned off overnight, and found that the monitors and stuff were still turned on - even though both computers were off. Disconnecting the USB connectors confirmed what I had suspected: the relays were stuck on - just like the prototype version.
I'd bought some solid-state relays before Christmas, for a different project (more details to come - once I've built it!). I had contemplated using them for the revision G board, but as I had the other relays, I wanted simplicity instead.
The solid state relays I've got are Sharp S202S02 relays. They're optically driven zero-point switching relays, capable of driving 8A - although it may need some cooling to do this. The data sheet also recommends a snubber - but I can't decide what type of snubber I need, so I'll leave it for the time being.
The new circuit
This is pretty similar to the old circuit - except there's no driving transistors for the solid-state relay as the PIC can drive LEDs directly.
This is a slighly redesigned PCB, and it's now L-shaped to allow a bit more space for the spade terminals (it was a bit of a tight squeeze). The four mounting holes are in exactly the same place, so I don't need to drill any new holes in the case. And the PCB under the USB sockets has been shortened, so I don't need to use quite so much PCB material.
In this design, I'd put a filled area for the earth on the mains side. THIS SHOULD BE REMOVED because it means you end up with a potential for a spark to jump the tracks. Alternatively, you can increase the isolation of the copper pour area.
In addition, I would cut a slot between the low-voltage and the high-voltage sections underneath the relays to provide even more of a gap (as it stands, it should be okay - but if moisture gets into the PCB, then a spark could jump the gap. With an air gap this is less likely).
My next version (which I've not documented yet) incorporated both of these. I'll do a write-up later...
Eagle PCB files
I had forgotten to provide them for the revision G board - but for this version you can download them. Note that I use Eagle PCB version 6, which uses XML as its format. If you are using versions prior to 6, you will not be able to read them. I won't be making version 5 (or even 4) PCBs, so if you want it - tough - you'll need to transcribe it from the PDFs.
As I'd used exactly the same hole locations on the PCB, I was able to re-use the box.
This is the board in the case. The L-shaped board allows the spade connectors to go past the PCB, whilst allowing a bit more space between the ones fitted on the PCB itself.
Testing it is a bit more difficult as you can't hear the relays click. However, I did find a change with the continuity tester between the switched live and the live feed when the board was on and off; a quick continuity test of the other signals showed me that it was working as expected (nothing untoward shorted), so I tried a live test - this went okay.
I ran it for about 20 minutes with the cover off to make sure that it didn't get too hot. It didn't seem to, although it was slightly warm. Just in case, I bolted an IC heatsink to the relays, and put the cover on it.
This is the heatsink I used. It's designed for a 28-pin DIL chip, and all I did was drill three 3mm holes in it (so I could decide the best orientation for the heatsink).
And with the case screwed up, it looks identical to the revision G board.
The code is identical to the old code - in fact, as I'd socketed the PIC, I just pulled it out and transferred it.
Does it work?
And now it's been two years since I made it, and it's still going strong. The only reason why I may re-make it is to remove the copper pour area.
If you want to make one, you'll need the following parts:
Note that you can change these parts for any equivalent. You can also use an IC socket for the PIC if you want (I always use turned-pin sockets for reliability).
|© Copyright 1997-2013|
Tribbeck.com / Jason Tribbeck
All trademarks are the property of their respective owners.