Do-it-yourself hub with external power supply. We build a USB hub into the keyboard

The problem of a lack of free USB ports in the workplace is always relevant. But also clutter the table extra wires I don't want to. Keyboard with built-in USB hub - great solution, but that's just a choice ready-made solutions not particularly big. Let's look at how you can add a USB hub to your favorite keyboard yourself.

The idea is this. We build in the hub in such a way that everything from the USB cable first goes to the hub, and the keyboard itself is connected to the hub itself. Those. the keyboard is soldered to one of its ports. This is how it was:

This is how it will become:

First, we need a USB 2.0 hub, this one on ebay.com costs about $2:

We disassemble the case, take out the board and see where it is more convenient to place it. The most convenient placement - left side keyboard, on the right - it will interfere with the mouse, on top - it’s not convenient to get into the connectors.

In my case, there was no room in the keyboard case, so I had to glue the housing for the hub on the outside of the keyboard. Material: pieces of black plastic, dichloroethane.

We disassemble the keyboard and lay a USB cable inside: from the cable entrance to the keyboard to the USB hub and from the keyboard controller to one of the USB ports of the hub (Figure 2). Here we need a piece of USB cable about 50cm long. We solder everything observing the pinout.

In this case, the USB hub port to which we solder the keyboard can be left, just do not make a hole in the case for it. I soldered it myself - it will be useful in computer farming.

After a day of work, I got this result. Fortunately, after making the Docking Station for an Android smartphone, I already had experience:

Of course, you can’t connect a hard drive through such a hub, there won’t be enough current. Considering that each port has 100mA - this is quite enough for flash drives, card readers, phones and cameras.

How to create a USB hub?

Master's answer:

A USB hub is a device that allows you to connect several devices to one USB port at once. As a rule, such a device is inexpensive, but you can make it yourself, which will reduce the final amount of your costs.

To get started, go to any of the workshops that repair monitors. You can ask them for a board that served as a hub built into the monitor. Usually, if the monitor is completely inoperative, such a board remains operational. If you were given such a board, then, in fact, you already have a ready-made working USB hub, it just lacks a housing.

Next, buy or ask someone for a cable, one end of which is connected like a regular USB plug to the computer, and the second - the same USB plug, but with a square cross-section. Typically, this cable is used to connect a printer or scanner to a computer.

On the board of the hub itself you need to find the contacts responsible for connecting external source nutrition. Next, you can take a power supply for a regular game console Sony PSP or any other having an output voltage of five volts and designed for maximum load at two amperes. Next, connect the unit to the board, remembering to observe the polarity.

Try to find special pads on your board that allow you to solder an LED to the board. If you find any, then solder a diode of any color you like onto the board. Sometimes you also need to solder in an additional resistor for the LED to work. Make sure the polarity is correct when doing this, otherwise the diode will not work.

Next, select a case for the board, any one, the main thing is that it fits in size. The material is preferably plastic. If necessary, cut holes in it for the LED and connectors. Then you need to secure the board in the case so that it does not dangle inside. For this, both ordinary bolts, screws and nuts, and racks that can be made from unnecessary old fountain pens are suitable.

After the hub is assembled, you can connect it to your personal computer or laptop. Don't forget to plug in the power supply. Now check its functionality. It should be remembered that you cannot connect devices to such a hub whose power consumption exceeds that which the power supply is capable of providing, otherwise you will disable the device you created yourself and may damage the USB port on your computer. In general, there are no other restrictions on use. The main thing is to use the device carefully and carefully.

Currently to connect peripheral devices most often used on a computer USB interface. Sooner or later, the user discovers that all the computer ports are occupied by the mouse, keyboard, WEB camera etc. and there is nowhere to connect a newly purchased printer, TV tuner, USB oscilloscope or anything else. Where to connect the 127 devices promised in the USB specification?

In order to one USB port In order to connect more than one device to a computer, hubs (HUBs), also called concentrators, are used. The hub converts one upstream port into several downstream ports. USB architecture allows serial connection up to 5 hubs.

In stores selling computer peripherals, the choice of hubs is quite large, to suit every taste, color and budget. It would seem that choose any, the most attractive design with the required number of ports and for the minimum price. After all, an inexperienced user often imagines a hub as something like a device for connecting two TVs to one antenna - a pair of resistors and capacitors.

However, in in this case everything is much more complicated. I was convinced of this when I purchased two USB hub a, one for the digital interface to the transceiver and the second for connecting external hard disk to a desktop PC.

The first hub for 4 ports with the "DNS" logo was purchased in a retail store, the second - for 7 ports from the manufacturer "No Name" I ordered in a foreign online store.

Experiments in laboratory conditions showed that both copies work without problems with a mouse, keyboard, USB-COM converter and USB audio card. However, with external hard drive and only a hub under the DNS brand works with a flash drive. When connecting a flash drive or hard drive to the nameless hub the computer displayed the message “USB device not defined.”

Additional experiments with the digital interface of the transceiver showed that the first hub (DNS) also works without problems, but the second (unnamed) causes the computer to freeze every time the transmitter is turned on. And the point here is not in matching the antenna with the transceiver, because... with direct, without a hub, connection of a USB-COM converter and an external sound card Everything worked with the computer without any problems.

This situation interested me and I decided to find out how these two USB hubs differ. Why does one fully perform its functions, and the second, in principle, works, but not always and not with all devices.

Imagine my surprise when, after opening the cases, it turned out that both hubs were assembled on the same element base and according to absolutely identical schemes! Only in the 7-port hub were two controllers installed in series. I’ll note right away that after the experiment with disabling the second controller, the situation did not change.

To understand the reason, I had to familiarize myself with the basic theory USB bus. The first USB 1.0 specification was published in early 1996, and in the fall of 1998, the 1.1 specification appeared to correct problems found in the first edition.

The USB 1.1 specification defines two data transfer modes: low-speed LS (Low-speed) - 1.5 Mbit/s and full-speed FS (Full-speed) - 12 Mbit/s.

In the spring of 2000 it was published USB version 2.0, which provided for a 40-fold increase in bus throughput. In addition to the two speed modes provided for by specification 1.1, a third was introduced - high-speed HS (High-speed) - 480 Mbit/s.

There is one subtle point associated with the “USB 2.0” logo. Bandwidth This interface, as stated above, is 480 Mbit/s, however, the specification includes the ability to operate devices in LS and FS modes. Thus, real throughput of 480 Mbit/s can only be provided by devices capable of operating in HS mode.

USB developers recommend using the "USB 2.0" logo only for HS devices, but marketing has its own laws and many manufacturers use this logo for FS devices, which are, in fact, USB devices 1.1. In other words, the inscription on the package “USB 2.0” does not mean anything. Real USB 2.0 devices are labeled "USB 2.0 HI-SPEED|" and an explicit indication of support for 480 Mbit/s bus speed.

480 Mbit/s is a square wave with a frequency of 480 MHz. For any specialist even more or less knowledgeable in radio engineering, it is clear that for undistorted transmission of rectangular pulses with such high frequency when developing topology printed circuit board approval requirements must be strictly adhered to wave resistance transmission lines.

The characteristic impedance of the differential signal lines from the controller to the connector on the board should be 90 Ohms +/-10%. The lines must run symmetrically, at a distance of at least 5 times the distance between them from other signal lines. There should be a continuous layer of foil underneath them all the way - a common wire. Areas where these requirements cannot be met (for example, connection points to the controller) must have a minimum length.

Well, of course, you need to comply with the usual requirements for the installation of RF circuits - all conductors must have a minimum length, blocking capacitors should be located as close as possible to the corresponding controller terminals, etc.

When looking at the photographs of the hubs' printed circuit board, it is clear that when installing a hub under the DNS brand, these requirements were more or less met.

The manufacturers of the NO NAME hub used a single-sided printed circuit board, so the characteristic impedance of the lines is very different from the standard 90 Ohms and there is a high sensitivity to electromagnetic interference

Both hubs use the same FE1.1s controllers. The manufacturer's website is http://www.jfd-ic.com/ unfortunately, only in Chinese.

To check the assumption that bad job hub was caused by ignoring the requirements of the USB specification for the PCB topology, I developed my own version of the board. Compared to the prototype, several additional blocking capacitors are installed on the board and, if possible, the installation requirements are met. Board size 75 x 60 mm.

The geometric dimensions of the signal lines to obtain the required characteristic impedance are calculated in the TX-LINE program, which is included in the Microwave Office package from National Instruments Corporation. This program itself is free and available for download on the company’s website http://www.awrcorp.com/ after registration. Just in case, I put it in the archive, the link to which is at the end of the page.

The program does not require installation, working with it is intuitive. You need to go to the tab with the line type - "Coupled MSLine", select the line material - Copper, enter the dielectric constant of the fiberglass Dielectric Constant = 5.5 and enter the line parameters. If we take the thickness of the fiberglass laminate to be 1 mm, the width of the printed conductors to be 0.7 mm, the distance between them to be 0.5 mm, the thickness of the copper foil to be 0.02 mm, and the line operating frequency to be 500 MHz, we obtain a characteristic impedance of about 93 Ohms.

The foil on the opposite side of the board serves as a screen. The holes for mounting parts are countersunk. In the color-coded through vias, pieces of wire are inserted, soldered on both sides of the board.

All passive SMD components standard sizes 1206 or 0805. Capacitors C6-C8 are tantalum. Resistor R1 2.7K +/-1%. Socket XS6 USB mini-BF, XS1-XS4 – USB-AF. Quartz resonator ZQ1 12 MHz. Capacitors C1-C3, quartz resonator ZQ1 and external power connector XS5 are mounted on the part installation side, the remaining elements are mounted on the printed conductor side.

Jumper S1 is installed if the HUB will be used as a passive one, i.e. all devices connected to it will receive power from the computer. If the HUB is to be used with devices that draw more than 500 mA current, power from the computer will not be sufficient. In this case, the jumper should be removed, and a stabilized 5 V power supply with the required power should be connected to the XS5 connector.

If it is possible to operate the hub both passively and active mode, instead of the jumper you need to install a diode with a Schottky barrier VD1 with permissible current at least 1 A, for example, SS24 to exclude the supply of voltage from an external power supply to the computer’s USB port.

In principle, to reduce the thickness of the board, all parts can be placed on the side of the printed conductors, but without metallization of the holes this complicates installation. By slightly adjusting the board design, you can change its size and the location of the USB ports to suit your specific needs.

Having tested the mounted board, I found that two of the four ports work great with a flash drive and USB hard drive, while the other two work only with a mouse. New mystery... But influence electromagnetic radiation completely disappeared.

I had to unsolder the second controller from the 7-port hub and replace the first one on a homemade board with it. Now three of the four ports are fully operational. Moreover, in High Speed ​​mode, the port stopped working, which functioned without problems with the first controller.

The Data Sheet on the FE1.1s states that all controllers are tested before being sold. Obviously, rejected copies are sent not to the trash, but to nameless manufacturers. Or there are some undocumented options in the controller. One way or another, the option with three full USB 2.0 ports suited me in principle.

I would like to draw your attention to the fact that almost all cheap hubs that have a connector for connecting an external power supply do not have any decoupling between external and internal power. Those. The power pins on all connectors are simply connected to each other. As a result, there is a chance to withdraw from building usb computer port by applying voltage to it from an external power supply connected to the hub.

Therefore, if you plan to connect an external power supply to purchased USB hub, you need to open its case and cut the trace from the power line of the upstream port connector (the one that goes to the computer). To maintain the ability to use the hub in passive mode, a diode can be soldered into this place, as shown in the circuit diagram. To reduce the voltage drop, you must use a Schottky barrier diode with a current of at least 1 A.

I would like to draw your attention to one more important detail - USB cable. According to USB 2.0 specification connecting cable must be shielded. When purchasing, it can sometimes be difficult to determine whether a cable has a screen or not. The only thing that may indicate the presence of a screen is the USB 2.0 HIGH SPEED marking on the cable. An indirect sign is also the presence of ferrite latches at the ends of the cable.

However, neither the markings nor the presence of latches say anything about the quality of the screen. IN good cable it should be made of foil wrapped around the conductors, over which a braided copper "stocking" is placed. Manufacturers often reduce the cost of production and use several copper-plated steel wires instead of a full-fledged screen.

If possible, the quality of the screen can be assessed by measuring the resistance between metal cases connectors on both ends of the cable. If the resistance is close to zero, the cable has a full copper screen. If the resistance is 3-4 ohms or more, there is a screen, but it is made of steel wires. This cable is usually thinner, but may cause problems when operating in electromagnetic interference environments. For example, if you place a cell phone next to the cable.

If the multimeter shows infinity, then the cable is not shielded and is not suitable for operation in High Speed ​​mode. In any case, the connector body should not be connected to any of the contacts. No independent soldering, splicing, shielding or replacement of connectors in the cable is permitted.

The most reliable selection criterion is transparent outer shell cable, through which the high-quality shielding braid is clearly visible. And if there are ferrite latches at both ends, then such a cable can safely be classified as PRO.

To summarize what has been said, I will formulate the main selection criteria quality USB 2.0 hub for working via a high-speed interface.

It is better to purchase a USB hub in retail stores, stipulating in advance the possibility of return or exchange for another model.

The packaging and case must have the “USB 2.0 Hi Speed” logo and a clear indication of support for 480 Mbit/s speed.

Immediately after purchase, and if possible before it, you should test the operation of all hub ports with a high-speed device, for example a USB 2.0 flash drive.

If you plan to use connecting cables to connect devices to a hub or a hub to a computer, it is better to give preference to those hub models in which all connectors are mounted in a housing on the board, because protruding “tails” with connectors almost certainly do not have screens. This will leave one end of the connected cable's shield hanging in the air, which may cause problems with High Speed ​​operation.

If you plan to use a hub with an external power supply, be prepared for the fact that the hub will probably need modification, as described above.

There is no overload protection in cheap hubs, no matter what is written on the packaging. It is assumed that it is in USB ports computer. A full-fledged hub with overload protection is a completely different price category.

Buy a quality shielded cable with HIGH SPEED written on it, if possible with a transparent outer jacket.

If none of the sold hub models suits you, make a USB hub yourself, as I described above.

If this simple device interests you, you can download its description at pdf format, a drawing of a printed circuit board in Sprint Layout, a diagram in sPplan, as well as a program for calculating the characteristic impedance of TX-LINE lines.

Household appliances

Refinement of the USB hub

To increase the number of USB ports personal computer, laptop, tablet computer or modern TV external USB hubs are used (they are also called USB hubs). For this purpose, as well as to reduce the likelihood of damage to expensive equipment due to a malfunction of the connected device, two unnamed concentrators were purchased (Fig. 1), designed for connecting four devices. In addition to USB outlets, they have a built-in power switch, LED indicator switch and a socket for connecting an external power source with an output voltage of 5 V DC (not included).

During the operation of the devices, some of their shortcomings were revealed. It turned out that both middle USB ports work worse than the extreme ones; when an external source is connected to the hub, the power from the USB port of a computer or other device is not turned off, since the power socket is installed without a circuit breaker; Finally, the LED shines too brightly.

To eliminate these shortcomings, the concentrator was disassembled (to do this, it is enough to unscrew two self-tapping screws). The device is assembled on integrated circuit, designated as LG347086212C. When examining the printed circuit board, it turned out that blocking capacitors EC1-EC3 (positioning designations are indicated on the board), for which there is a place on it, are missing. The capacity of the ceramic blocking capacitor installed in the power circuit turned out to be only about 4.3 μF, which is obviously small for similar devices.

A fragment of the modified concentrator circuit is shown in Fig. 2. The positional designations of the newly introduced elements begin with the prefix 1, the rest correspond to the inscriptions on the board. Oxide capacitors EC1-EC3 with a capacity of 22 μF were installed in the places provided by the manufacturer. To reduce the possibility of damage to the concentrator when increased voltage external power source or its “reversal of polarity”, a protective zener diode 1VD1 is introduced, and in order to reduce the brightness of the glow LED, resistor R6 (330 Ohm) is replaced by a resistor with a resistance of 1.2 kOhm.

Blocking capacitors EC1 - EC3 - small-sized oxide aluminum or tantalum with a capacity of 22-47 μF in a housing no more than 8 mm high. Instead of the KS156A zener diode, you can use KS156G, 2S156A, KS456A, 1N4734A, 1N5339. Whenever emergency situation, for example, due to short circuit, self-resetting fuses installed on the computer system board may trip. Since such fuses are usually rated for a current of 1.6...3.6 A, which is not a lot, damage to the USB connecting cable is also possible. In older computers, to protect the USB ports and power supply from overload, motherboards Not polymer self-recovering fuses, but disposable fuses can be installed. Due to the lack of a socket with a built-in switch, the power supply circuit had to be changed. Now, when the hub is operating from an external source, power from the computer’s USB port can be turned off using switch SA1. A 1L1 inductor is soldered to the printed contacts for connecting the wires coming from the switch (any small-sized one with an inductance of 22.100 μH and a resistance DC no more than 0.04 Ohm), which, together with blocking capacitors, forms an LC filter for the supply voltage. Finally, after a careful inspection of the board, defects in several soldering pins of USB sockets to printed conductors were eliminated. The installation view of the modified device is shown in Fig. 3.

Another drawback of the concentrator has also emerged. The fact is that to connect it to the computer, an unshielded four-wire cable approximately 550 mm long is used, on which, when connected to a load hub that consumes a current of 0.5 A, about 0.5 V drops. To eliminate this drawback, the cable should be replaced , having bought, for example, for this purpose USB extension cable 2.0, in which the power wires (usually insulated in red and black) have a larger diameter and, therefore, less resistance. If it is not possible to purchase such a cable, then the existing one should be shortened to 100.150 mm.

For powering devices connected to a universal USB hub, any source with an output constant voltage 4.9.5.25 V, designed for a maximum load current of 1.1.5 A, for example, network adapter TESA5-0035015dV-B included in the kit mobile devices (tablet computers, e-books) from Texet with a large LCD screen.

Additional external power may be required if devices with high current consumption from the USB port are connected to the hub, for example, an external hard drive, LED flatbed scanner, external USB optical CD read/write drive.