Silicon ChipUSB Printer Share Switch - April 2009 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Everyday solvents can be dangerous
  4. Feature: Digital Radio Is Coming, Pt.3 by Alan Hughes
  5. Feature: Wireless Networking With Ubuntu & Puppy Linux by Greg Swain
  6. Project: Multi-Function Remote-Controlled Lamp Dimmer by Mauro Grassi
  7. Project: School Zone Speed Alert by Jim Rowe
  8. Project: USB Printer Share Switch by Jim Rowe & Greg Swain
  9. Project: Build A Microcurrent DMM Adaptor by David L. Jones
  10. Review: Tektronix MSO2024 Mixed Signal Oscilloscope by Mauro Grassi
  11. Vintage Radio: The Airzone 520/550 5-valve mantel receiver by Rodney Champness
  12. Feature: Half-Duplex With HopeRF’s HM-TR UHF Transceivers by Stan Swan
  13. Book Store
  14. Advertising Index
  15. Outer Back Cover

This is only a preview of the April 2009 issue of Silicon Chip.

You can view 33 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Digital Radio Is Coming, Pt.1 (February 2009)
  • Digital Radio Is Coming, Pt.1 (February 2009)
  • Digital Radio Is Coming, Pt.2 (March 2009)
  • Digital Radio Is Coming, Pt.2 (March 2009)
  • Digital Radio Is Coming, Pt.3 (April 2009)
  • Digital Radio Is Coming, Pt.3 (April 2009)
  • Digital Radio Is Coming, Pt.4 (June 2009)
  • Digital Radio Is Coming, Pt.4 (June 2009)
  • Digital Radio Is Coming, Pt.5 (August 2009)
  • Digital Radio Is Coming, Pt.5 (August 2009)
Items relevant to "Multi-Function Remote-Controlled Lamp Dimmer":
  • Intelligent Remote-Controlled Dimmer PCB [10104092] (AUD $10.00)
  • PIC18F1320-I/SO programmed for the Intelligent Dimmer [1010409A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC18F1320 firmware and source code for the Intelligent Remote-Controlled Dimmer [1010409A.HEX] (Software, Free)
  • Intelligent Remote-Controlled Dimmer PCB pattern (PDF download) [10104092] (Free)
  • Intelligent Remote-Controlled Dimmer panel artwork (PDF download) (Free)
Items relevant to "USB Printer Share Switch":
  • Manual 2-Way USB Device Switch PCB [07104091] (AUD $5.00)
  • USB Print Share Switch PCB pattern (PDF download) [07104091] (Free)
  • USB Printer Share Switch front panel artwork (PDF download) (Free)
Articles in this series:
  • Amateur Radio (November 1987)
  • Amateur Radio (November 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (February 1988)
  • Amateur Radio (February 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (January 1989)
  • Amateur Radio (January 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (February 1990)
  • Amateur Radio (February 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (July 1990)
  • Amateur Radio (July 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (January 1991)
  • Amateur Radio (January 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (January 1992)
  • Amateur Radio (January 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (January 1993)
  • Amateur Radio (January 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (February 1994)
  • Amateur Radio (February 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (January 1995)
  • Amateur Radio (January 1995)
  • CB Radio Can Now Transmit Data (March 2001)
  • CB Radio Can Now Transmit Data (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • Stressless Wireless (October 2004)
  • Stressless Wireless (October 2004)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Dorji 433MHz Wireless Data Modules (January 2012)
  • Dorji 433MHz Wireless Data Modules (January 2012)

Purchase a printed copy of this issue for $10.00.

Share a USB printer or other USB device between two PCs Manual 2-Way USB Device Switch This simple device allows two computers to share a single USB printer or some other USB device, such as an external flash drive, memory card reader or scanner. A rotary switch selects the PC that you wish to use with the USB device, while two LEDs indicate the selected PC. By JIM ROWE & GREG SWAIN T HE MOST COMMON way to share a USB printer between two PCs is to use one machine as a print server. However, that’s not always convenient because it means that the server PC must always be on if you want to print something. That can be a real nuisance if you just want to quickly fire up the other machine and print something out. It also means that the two PCs must be networked together, either via a hub/router or directly via an ethernet crossover cable. Another way is to use a dedicated USB print server. However, as before, this must be connected to an ethernet 42  Silicon Chip network, along with the PCs. Such devices also need their own power supply, generally cost well over $100 and are overkill if you just want to share a single USB printer between two computers for occasional printing in a home set-up. That’s where this simple device comes in. It’s basically a 2-way switch box that lets you manually switch your USB printer from one PC to the other, as required. The switching is performed using a rotary switch, while two LEDs on the front panel indicate which PC has been connected to the printer. This method has several advantages. First, you don’t need to network your two computers. Second, you can print from either machine with the other turned off. And third, the device doesn’t need a power supply. It’s also cheap to build and easy to set up – just run standard USB Type A to Type B cables from your PCs to the USB Switch and connect a third cable from the switch to the printer. That’s it. Other devices This device is not simply confined to switching a USB printer – it can also be used to switch other USB devices, such as USB flash drives, memory siliconchip.com.au FROM PC1 (1) 1 S1a 2 3 4 V+ (2) CON1 USB TYPE B SOCKET S1b TO PRINTER D– 1 2 FROM PC2 3 S1c 1 4 D+ CON3 USB TYPE A SOCKET 2 3 4 A CON2 USB TYPE B SOCKET A LED1  K  S1d 470 K LED2 GND SC 2009 card readers, USB digital picture frames and scanners. However, if you are switching a USB flash drive, you must always be sure to go through the “Safely Remove Hardware” procedure before switching over, otherwise you could lose data. Circuit details Let’s take a look now at the circuit – see Fig.1. There’s not much to it. At the left, we have two USB Type B sockets to accept the signals from the two PCs (PC1 & PC2). These are the upstream ports and their V+, D- and D+ (data) lines are connected to switches S1asiliconchip.com.au K A Fig.1: the circuit uses switch poles S1a-S1c to select either USB socket CON1 or CON2 and connect its pins through to CON3. The fourth pole (S1d) selects either LED1 or LED2, to indicate which PC has been selected. 470Ω 3 2 4 1 CON1 LED1 A PC2 PC1 CON3 PC1 4 3 2 3 2 4 1 CON2 1 LED2 TO PRINTER FROM PC1 1 PC board, code 07104091, 77 x 46mm 1 UB5 plastic utility box, 83 x 54 x 31mm 1 front panel label, 48 x 77mm 2 Type B USB sockets, PC-mount (CON1, CON2) 1 Type A USB socket, PC-mount (CON3) 1 PC-mount 4-pole, 3-position rotary switch 1 knob to suit 4 M3 x 15mm tapped spacers 4 M3 x 6mm machine screws 4 M3 x 6mm countersink-head machine screws 2 3mm red LED (LEDs1&2) 1 470Ω resistor USB PRINTER SHARE SWITCH FROM PC2 Parts List LEDS S1 A PC2 H C TI W S R E T NIRP B S U 19040170 9002 © Fig.2: install the parts on the PC board as shown here. Note particularly the orientation of switch S1. It’s mounted so that the flat side of its shaft faces CON3 when the switch is in the centre position. S1c respectively, while their GND terminals (pin 4) are commoned and fed through to pin 4 of USB Ty pe A socket CON3. Basically S1 is wired as a 4-pole 3-position switch. However, the centre position is unused. That’s been done to ensure a clean break when switching between positions 1 & 2 of each pole, so that either a break-before-make or a make-before-break switch can be used. In operation, S1a-S1c simply select between USB sockets CON1 and CON2. In position (1), the outputs from CON1 are selected and fed through to the downstream USB output socket (CON3). Conversely, in position 2, CON2’s outputs are selected and fed through to CON3. Switch pole S1d selects between LED1 and LED2, to indicate which input socket (and thus which PC) is selected. These two LEDs connect to the V+ (+5V) lines from CON1 & CON2 respectively, while the associated 470Ω resistor to ground provides current limiting (to about 10mA). As a result, LED1 lights when S1 selects position 1 (CON1), while LED2 lights for position 2 (CON2). CON3 is a USB Type A socket. This is connected to the USB device (eg, a printer) via a standard USB Type A to Type B cable. Construction All the parts for the USB Switch are mounted on a small PC board coded 07104091 and measuring 77 x 46mm. This assembly fits inside a standard UB5-size plastic utility box, with recApril 2009  43 B B 9 PC2 PC1 14 9 A A 17.75 SILICON CHIP USB SWITCH C 18.25 18.25 16.5 B B PERIPHERAL 17 ALL DIMENSIONS IN MILLIMETRES CL HOLES A: 3.0mm DIAMETER HOLES B: 3.0mm DIAM, CSK HOLE C: 9.0mm DIAMETER Fig.3: this diagram shows the drilling and cutout details for the lid (left), together with the full-size front-panel artwork (right). This is the fully-assembled PC board. Be sure to install the rotary switch with the flat side of its shaft towards CON3 (at right) when the switch is in the centre position. The LED leads are soldered after the board has been attached to the lid (see text). The PC board is attached to the lid of the case using four M3 x 15mm tapped spacers and M3 x 6mm machine screws. 44  Silicon Chip tangular cutouts at either end to access the USB sockets. Fig.2 shows the parts layout on the PC board. Begin the assembly by installing the five wire links and the 470Ω resistor. The three USB sockets can then be installed. Make sure these sit flush against the PC board before soldering their pins and don’t forget to solder the large tabs on either side of each socket. Switch S1 is next. First, cut its shaft to 10mm, then install it on the board so that the flat side of the shaft faces CON3 when the switch is in the centre position. Be sure to push the switch all the way down so that it sits flush against the board before soldering its pins. Once the switch is in, fit an M3 x 15mm tapped spacer to each corner mounting position. Secure these using M3 x 6mm screws. The board assembly is then complete except for the two LEDs, which we’ll come to shortly. Final assembly Fig.3 shows the drilling details for the case lid. Four 3mm mounting holes are required for the PC board, two 3mm holes for the LEDs and a single 9mm hole for the switch shaft. Fig.3 also shows the full-size artwork for the front-panel label. This can either be photocopied or downloaded from the SILICON CHIP website and printed out. Protect it by covering it with clear contac film, then attach it to the lid using a thin smear of silicone sealant as the adhesive. Wait until the silicone dries before cutting out the holes using a sharp hobby knife. The PC board can now be attached to the lid. First, slip the two LEDs into position (check their orientation), then secure the board to the lid using four M3 x 6mm countersink-head screws. That done, fit the switch nut, then push the LEDs through their front-panel holes and solder their leads. The final step is to make the cutouts in the ends of the case for the USB sockets. You will need two 12 x 10mm cutouts for the type B sockets and a 17 x 9mm cutout for the type A socket. These can be made by first marking out their positions, then drilling a series of holes around the inside perimeters, knocking out the centre pieces and filing them to a neat finish. That’s it – your USB Switch is now complete. Attach the lid to the case, fit SC the knob and it’s ready to go. siliconchip.com.au