Friday, August 19, 2011

USB Switch





To share a regional press as USB printer, scanner etc. two computers is relatively easy. Just connect the two computers on a network device and say the printer as shared. This method however requires the continued operation of the computer we plugged the printer. Solution to above problem is to give the circuit that we present, as has the ability to be transferred to the printer in any one of the two computers we want, because the printer is connected to one of the two computers, but in our manufacturing.
 

With lower prices on laptop computers became affordable sailer acquisition and the average Greek. Getting two computers, however, automatically generated and the need to link with the most common peripherals already available, such as printer, scanner, the WEB camera, the ISDN NetMod and more. For selecting the type of peripheral interface with the computer we took into account that most modern peripherals are interconnected USB, leading us to this choice. As regional USB to mention USB printer. In his place may well be a scanner, a camera or other USB device preferably low-speed USB 1.1 (1.5 Mbps), this does not mean it can not work with devices and USB 2.0. But since our manufacturing include mechanical parts, perhaps   create communication problems of some regional through the floor construction, because of both high speed as this USB 2.0 (480 Mbps) and "noise" generated in the contacts of the relay. According to the block diagram of Figure 1, the printer connects to the computer and the microcontroller No1 computer No2. When given a command from the software the construction (USBswitch. exe), is the cross-switching devices and the printer is now No. 2 on the computer while the computer microcontroller No1.


Figure 2: The theoretical circuit construction.
The theoretical circuit The circuit consists of a few parts because the microcontroller IC 1 to take control of where it is attached printer, and is responsible for communicating with software the computer via USB. The supply of construction is of the USB ports on both computers, as well as provide voltage +5 v with a maximum current of 500 mA each, capable of not only the power of our workmanship but also for the regional will connect. Furthermore, this ensures the smooth operation of our construction where we have a single computer. The data signals D +   and D - the USB bus are level 0 and +3.3 V. The IC 1 but operates with TTL levels 0 and +5 V. So there are two ways to customize: or to build a converter station from the   5 V at 3.3 V and back to the data bus D + and D - or down trend   supply of IC 1 to 3.3 V when the signal level will be between 0 and 3.3 V. The Atmel We guarantee that the operating voltage of a ATtiny 2313 is between 2.7 V and 5.5 V, so we chose the second way, namely the operation of IC 1 to 3.3 V.   Instead of a stabilizer to 3.3 V chose three diodes 1 N 4001 (D 5 - D 7) that the proper time, creating a voltage drop 0.7 V hence VCC = 5 - (0.7 * 3) = 2.9 V. These in theory because in practice the voltage is about 3 V. The specification of the USB bus for low-speed devices is 2.7 - 3.6 V so that 3 V enough. R 6 is the load impedance to ensure circuit always 3 V. The relay RE 1 and RE 2 assume connecting IC 1 with the first and the second printer to the computer. The RE 1 working backwards from RE 2. That is reinforced when the RE 1, the RE 2 is disarmed, and vice versa. When the base of T 1 we have 0 V, the transistor will not conduct and therefore the collector will   have +5 V Winding through the RE 1. This trend of 5 V is driven into the base of T2 putting a state conductivity. By the same logic when the base of T1 will have 3 V, will pass a state conductivity dropping the voltage of the collector to 0 V and thus drive the RE 2 disarm. The diodes D 1, D 3 are used to protect the T1 and T2 of the reverse currents generated in the windings of RE 1 and RE 2. The LEDs D 2, D 4 are indicative of the state of each relay (ON - OFF). The relays have a rated voltage of 6 V DC and consumption is a ~ 20 mA. For this reason we chose to arm only one at a time and not to arm or disarm both simultaneously, thus reducing the overall power consumption of the circuit. The R 7, R 8 is terminating resistors of the bus USB.   By R 9 Poles D - USB port to +3 V thus declaring the existence of low-speed device USB (1.5 Mbps). Building the circuit The construction of the circuit will not be a problem because of the simplicity. Little attention should be paid to the polarity of the materials (diodes, capacitors, integrated). Glue the first shorter and smaller components and then larger and taller. The black lines connecting the holes in the plan of placing materials are wire bridges on top of the board. The LEDs D 3, D 4 and resistors R 1, R 2 can not be placed on reducing power consumption by 6 mA. If you can not find ATtiny 2313 to market you in a position to schedule the same files. Hex and. eep an AT 90 S 2313 and put on the same basis as they have the same layout on the pins. If, after connecting the peripheral with the computer, show you the message that found an unknown device and you have already installed drivers will need to remove one of the diodes D 5 and D 6 and D 7 and the position of sticking a wire bridge. With this conversion will increase the voltage VCC from 3 V at 3.7 V, sufficient for the proper functioning of the AT 90 S 2313. The AT 90 S 2313   can operate from 2.7 V - 6 V. Then why should move up the voltage to 3.7 V and can be operated with 2.7 V; The reason is simple. The operating voltage is 2.7 V as the maximum operating frequency, which is 10 MHz. In our case, however, the operating frequency is increased to 12 MHz ie 20% more (overclocking). For this reason we can not work at lower voltage. On the other hand, ATtiny 2313 has a maximum operating frequency of 20 MHz so that we can comfortably operate at 2.7 V. Programming IC1 The microcontroller IC 1 should be programmed with two files. Flash memory you should plan to file USBswitch. hex and internal memory eeprom the file USBswitch. eep. If you do choose ATtiny 2313 against AT 90 S 2313 should range from <Fuses> programmer you make sure that option is checked <Ext. Crystal Osc.; Frequency 8 -    MHz; Start-up time 14 CK + 65 ms; (CKSEL = 1111 SUT = 11)>. This will have to check because this microcontroller has the ability to activate the internal oscillator 0.128 - 8 MHz, and should make sure that is selected using the external crystal frequency of 8 MHz more. Operation When connected to our manufacturing in a free USB port the computer through port K1, the computer will recognize a new device and will ask drivers (Drivers). The driver for the device «USB switch »is in the folder« Driver »and consists of three files: AVR 309. dll,   AVR 309. Inf and AVR 309. sys.   After   installing the drivers, our device will be ready for use. Both computers must have installed the drivers and the program «USBswitch. Exe». When you connect both computers with our device, install drivers and run the program USBswitch. Exe, we see that the computer will see a message of Figure 3 and in another the message of Figure 4. In this will display the message in Figure 3 will be connected to the printer. In this case, as you see the button "Connect to a common regional" is disabled because we have already connected the printer to this computer. In the case of Figure 4, the program informs us that the device "USB switch "   ie essentially the IC 1, has been found and we can press the button   "Connecting with the common regional USB» to the IC 1 to change the status of relays and switches the printer on this computer. If you do not install the driver, can not run the program.


Figure 3: When the computer is connected to the printer displays this message.


 Figure 4: When the computer is not connected to the printer displays this message.



 MATERIALS
C1: 100nF
C2: 470mF/16V
C3: 22 pF
C4: 22 pF
D1, D3: 1 N 4148
D2, D4: LED
D5, D6, D7: 1N4001
IC1: ATtiny2313 (see text)
K1: Plug onboard USB-B
K2 : Plug onboard USB-A
K3: Plug onboard USB-B
R1, R2: 1k
R3, R4, R5, R6: 10k
R7, R8: 56R
R9: 1k5
RE 1, RE 2: Relay 6 V, duplicate contacts.
T1, T2: BC547
X1: 12 MHz
Cost of materials:   20 €
Difficulty of manufacture: * Inaccessible materials: *


Source by : http://www.serasidis.gr/
Designed by: Vassilis Serasidis

No comments:

Post a Comment

Terima kasih atas komentar yang anda sampaikan , sehingga dapat menambah wawasan saya sebagai penulis dan membuat blog ini semakin berguna banyak orang