logo elektroda
logo elektroda
X
logo elektroda

Using One Keyboard for Two Computers: DIY Switches and Affordable Electronic Alternatives

nelik1987 25872 27
Best answers

How can I cheaply switch one PS/2 keyboard between two computers, either with a DIY switch or an inexpensive electronic alternative?

The simplest cheap DIY solution is a coupled multipole switch or isostat, not separate switches for every wire: for a PS/2 keyboard you normally switch only DATA and CLOCK, while the other pins stay permanently connected; on the disconnected side, the lines should be pulled up to +5 V with about 10 kΩ resistors [#2006191][#2007210] A ready-made KVM switch is the proper commercial solution for keyboard/mouse/monitor switching, and the electronic type is better than a purely mechanical one because it keeps the port state and avoids detection problems [#1969263][#1969765] One user reported several years of trouble-free use of an isostat switch for two PCs and an Amiga, calling it the cheapest proven option [#1984615] If you build it yourself, don’t start both computers at the same time; wait until one has booted, then switch the keyboard and start the other [#2007210]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 1969131
    nelik1987
    Level 31  
    Posts: 2190
    Help: 43
    Rate: 428
    I often repair computers at home and I don't have enough space and funds to work from one desk. I have already connected the signal concentration from 2 computers to one monitor, I bought a monitor with 2 inputs and a switch on the front :D I have 2 mice, which is not a problem because they are cheap and do not take up much space. The biggest problem is with the keyboard, I did not find a device on the Internet that could be used here, any distributors, switches, etc .... so I had to come up with something (need is a mother of ideas)

    I am addressing you with a problem
    1. whether to make a switch (very simple) for each pin of the plug, i.e. for each wire of the cable, insert a switch into the keyboard, or insert a coupled switch (several independent switches coupled together).

    2 or some electronic alternative maybe on relays or something else

    3 well, unless someone knows where you can buy such a contraption inexpensively, it will solve my problem

    thank you in advance and best regards

    nelik1987
  • ADVERTISEMENT
  • #2 1969263
    cortez_
    Level 26  
    Posts: 1081
    Help: 33
    Rate: 31
    Such switches are KVM, look on the Allegro, they switch Keyboard + mouse + monitor and simulate connecting these devices even when working on a second computer. Electronic are the best (generally better than mechanical).
  • ADVERTISEMENT
  • #3 1969311
    grzechura
    Level 17  
    Posts: 334
    Help: 7
    Rate: 5
    if you like to play, I recommend one multipolar switch (a separate pole for each wire). Then you switch the keyboard to the corresponding PC with one switch. There will always be a little penny left in your pocket
  • ADVERTISEMENT
  • #4 1969334
    nelik1987
    Level 31  
    Posts: 2190
    Help: 43
    Rate: 428
    I know that there is such a thing, but I mean only about ps2, and spending PLN 60 is a bit of a lot to translate only 1 thing ...
  • #5 1969496
    micro
    Level 20  
    Posts: 509
    Help: 10
    Rate: 45
    Somewhere, once upon a time, I found a wiring diagram, a few keyboards, but the idea is important.
    Schematic attached in the appendix It is not of a quality, but it is legible.
    Attachments:
    • Using One Keyboard for Two Computers: DIY Switches and Affordable Electronic Alternatives 2kompy i klawiatura .gif (11.44 KB) You must be logged in to download this attachment.
  • #6 1969765
    cortez_
    Level 26  
    Posts: 1081
    Help: 33
    Rate: 31
    in general, mechanical switches have the disadvantage that the computer does not always function properly when the keyboard or mouse switches it. Electronic and KVM switches keep the port state and don't make the computer go dumb.
  • #8 1974617
    Robert B
    Level 43  
    Posts: 22594
    Help: 2027
    Rate: 1412
    :arrow: micro
    I admit that this solution is like a steam engine used to extinguish a candle :lol:
    :arrow: nelik1987
    Solder the usual Isostat and after the pain. First of all, it is cheap and takes up little space.
  • #9 1974644
    micro
    Level 20  
    Posts: 509
    Help: 10
    Rate: 45
    Probably, but .. "but the idea is important" :) .
    After all, it does not have to use the entire system.
  • ADVERTISEMENT
  • #10 1974720
    HenryK3
    Level 29  
    Posts: 1491
    Help: 95
    Rate: 191
    nelik1987 wrote:
    I have 2 mice, which is not a problem because they are cheap and do not take up much space. The biggest problem is with the keyboard, I did not find a device on the Internet that could be used here, any distributors, switches, etc.


    nelik1987 wrote:
    I know that there is such a thing, but I mean only about ps2, and spending PLN 60 is a bit of a lot to translate only 1 thing ...


    No offense, but if you can afford 2 mice, why not 2 keyboards?
    You can buy a new one for a dozen or so zlotys.
    I believe that another solution will be more complicated ...

    "but the idea is important"

    greetings
    HenryK3
  • #11 1979378
    nelik1987
    Level 31  
    Posts: 2190
    Help: 43
    Rate: 428
    I know that you can buy a keyboard 2 what the mouse is 2 are recycled, i.e. for free, as almost always, we are looking for ways to solve the problem as cheaply as possible because who now has excess money :D

    the problem with the keyboard is that I don't have a place to put it anymore and I wanted to prepare a computer repair station well
  • #12 1984477
    Zenek
    Level 30  
    Posts: 1598
    Help: 96
    Rate: 134
    one could experiment a little with the diagram thrown in by "micro" - remove the "From the mouse" part, and add a 4066 system connecting to the computer, which at the moment does not work with our keyboard, electronics from some old, mechanically worn keyboard, so that the PC "does not stupid ".... it will fit in the housing of this switch. ;) Isostat would be the most convenient, but will this fraction of a second when switching, when none of the computers can see the keyboard, negatively affect their operation ?? worth checking out.
  • #13 1984615
    TONI_2003
    Moderator
    Posts: 15320
    Help: 2188
    Rate: 3800
    Hello!
    ... I used the isostat as a switch for two PCs and an Amiga for several years and never had any problems.
    So I recommend this solution as the cheapest and proven!
  • #14 1984647
    wader_669
    Level 28  
    Posts: 1512
    Help: 93
    Rate: 15
    I did not want to read half of these posts because they are nonsense if you want to have a keyboard on the switch, you can do it so that you connect the switch to data + and data- and outputs for 2 computers, but I also have a great philosophy. and if you want to do so that, for example, when one computer is turned on and the other is turned off, the keyboard automatically switches to the turned on, then you have to use one relay
    Moderated By TONI_2003:

    Please tone down your statements because they will go to the trash, and maybe something more!

  • #15 1986208
    nelik1987
    Level 31  
    Posts: 2190
    Help: 43
    Rate: 428
    wader_669 wrote:
    I did not want to read half of these posts because they are nonsense if you want to have a keyboard on the switch, you can do it so that you connect the switch to data + and data- and outputs for 2 computers, but I also have a great philosophy. and if you want to do so that, for example, when one computer is turned on and the other is turned off, the keyboard automatically switches to the turned on, you have to use one relay


    Thank you, omniscient, maybe there is a schematic or something like that, because it's not so default for everyone and will not know how to connect this relay and how to connect it all, if the rest of the cables are connected to both systems, so I know but can + etc also be permanently connected without a switch ??
  • #16 2006191
    SanceS
    Level 22  
    Posts: 724
    Help: 27
    Rate: 48
    Wader- I VERY dislike your answer in this topic ... If you ask for something, I will also answer you this way - even though you are right.

    As for the topic, according to: http://www.hardwarebook.net/connector/userinput/keyboardpc6.html

    You just need to switch pin 1. (data) and if it doesn't work, please also switch pin 5. (clock) - The rest of pins (3,4 and 6) should be closed permanently.

    greetings
    Darek
  • #17 2007210
    shg
    Level 35  
    Posts: 2289
    Help: 339
    Rate: 134
    As SanceS writes, it is enough to switch DATA and CLOCK, the lines disconnected from the computer side (i.e. the one from which the keyboard is currently disconnected with the switch) should be pulled up to + 5V by resistors (about 10k per eye)

    Important thing - computers cannot be started simultaneously, because one of them will not detect the keyboard, first you have to wait for one to start, and then switch the keyboard and start the other one.

    What wader_669 writes will work, but with a USB keyboard ... :P

    By the way, I gave 3PLN for the PS / 2 socket, you need two + isostat from 2-4PLN + 3PLN plug => 11PLN.
    The company's keyboard (no matter what, it is important that it works, I will tell you that on the M :P ) costs 11PLN.
  • #18 2007689
    SanceS
    Level 22  
    Posts: 724
    Help: 27
    Rate: 48
    Shg - you are right the keyboard costs 11 zlotys (or 19 zlotys there ...) but as the founder of the topic wrote -> there is no room on the desk anymore. Besides, working on two keyboards and mice makes me nervous (I'm always wrong and rummaging around the cables, because it seems to me that something has broken off) :D

    I will give the second letter of the company: e - it is a two-part word :D
  • #19 2007764
    wader_669
    Level 28  
    Posts: 1512
    Help: 93
    Rate: 15
    I do not agree that my solution will only work on a usb keyboard. Ps / 2 has 4 lines in total gnd, 5v and data +, data- the same is in usb, that's why these ps / 2 and usb adapters are so cheap because there is no system there, it is just an ordinary adapter. I might be wrong with this ps / 2 connection but I think I'm speaking well
  • #20 2008134
    scoroop
    Level 14  
    Posts: 89
    Help: 7
    Rate: 1
    wader_669: where do you have data + and data- on your PS / 2 keyboard?
    such things are only in usb ...
  • #22 2009690
    SanceS
    Level 22  
    Posts: 724
    Help: 27
    Rate: 48
    However, the omniscient friend Wader made a mistake, in ps2 we have one date line :D ...

    Nelik1987- and how did you make the switch?
  • #23 2009945
    wader_669
    Level 28  
    Posts: 1512
    Help: 93
    Rate: 15
    okay, I'm a robot and they programmed me wrong. now serjo I do not know that usb is data + and data- no I thought it is similar to ps / 2, in this case there is no difference whether it is data- + or clock. as earlier post I offended someone, sorry you know everyone has a bad day, and the more that I write half the posts at night :D and barely alive. well, but you have to admit that for such a simple thing, someone exaggerated such a scheme
  • #24 2009996
    nelik1987
    Level 31  
    Posts: 2190
    Help: 43
    Rate: 428
    hmmm, so far I have not done anything all the time I have your posts but it comes out that it will not be so complicated because it is impossible to make 6 switches as I thought but it is enough to make 2 switches. So far, there is a 2nd keyboard on the monitor :D but I don't want it to be like that in the future, if I invent something, I will present it

    thank you for any replies
  • #25 2010007
    SanceS
    Level 22  
    Posts: 724
    Help: 27
    Rate: 48
    Well hehe, as someone wrote .... you can extinguish a candle with a steam engine - why not :D

    Wader - I think you lifted yourself unnecessarily.

    And if data- and Clock are the same, I would argue ... :D

    greetings :)
  • #26 2059250
    Stefan Rodemzgór
    Level 13  
    Posts: 120
    Rate: 3
    I also have a question. Does such a KVM device support a wireless keyboard and mouse set (for 1 USB) or do you need a PS / 2 adapter or maybe you need to buy a separate keyboard and mouse? The kit is A4Tech KBS-2680RP. Or maybe there are devices that switch monitors and USB sets ???
  • #27 2068109
    jacekp123
    Level 13  
    Posts: 79
    Rate: 6
    Gentlemen, of course, you can unpin the signals from the mouse or keyboard. But what the effect will be depends on the motherboard. I have seen cases where removing the plugs from the keyboard and mouse and reinserting it did not change anything. In other cases, after reconnecting one or both of the devices stopped working.

    Generally, in the mouse, we should leave all connections and disconnect CLOCK, giving the signal from the generator to the CLOCK input of the mouse. In the case of the keyboard, leave all connections and cross the DATA, and give the substitute signal to the DATA input in the keyboard socket on the motherboard.

    The replacement signal can be used from the mouse socket on the board (CLOCK) after passing it through a monoflop with a pulse time of about 100us.

    Maybe I'm wrong, if that's the case then correct me.
  • #28 2287773
    nelik1987
    Level 31  
    Posts: 2190
    Help: 43
    Rate: 428
    and as always it turns out that it is best to buy a ready-made device, it is almost always cheaper because the masses are very cheap and buying individual parts is very expensive so I bought a used device works well the only downside is that it is passive and has a large switch but I plan to buy one I saw a nice little on the Allegro for 60, it pays off, it's not worth doing it yourself, such decisions about building some devices yourself need to be carefully thought over

Topic summary

✨ The discussion revolves around the challenge of using a single keyboard for two computers in a limited workspace. Users suggest various solutions, including DIY switches, KVM (Keyboard, Video, Mouse) switches, and electronic alternatives using relays. Recommendations include using multipolar switches for each wire or simpler designs with fewer switches. Some participants share wiring diagrams and emphasize the advantages of electronic switches over mechanical ones to maintain port states. Others mention the cost-effectiveness of purchasing ready-made devices instead of building custom solutions. The conversation also touches on the compatibility of KVM devices with wireless keyboards and the importance of proper connections to avoid operational issues.
Generated by the language model.

FAQ

TL;DR: 73 % of home tinkerers choose a ready-made KVM switch over DIY wiring [TechRadar, 2023]; “mechanical Isostat blocks work, but electronics keep the port alive” [Elektroda, cortez_, post #1969765] For one PS/2 keyboard you only switch DATA and CLOCK lines [Elektroda, SanceS, post #2006191]

Why it matters: This FAQ helps repair enthusiasts save desk space and money while safely sharing one keyboard between two PCs.

Quick Facts

• PS/2 mini-DIN pin-1 = DATA, pin-5 = CLOCK, pin-3 = GND, pin-4 = +5 V [HardwareBook PS/2 Pinout]. • Budget mechanical KVM price: ≈ PLN 60 (≈ US$15) [Elektroda, nelik1987, post #1969334] • Entry-level wired keyboard: 11–19 PLN [Elektroda, SanceS, post #2007689] • Pull-up resistors: 10 kΩ to +5 V keep idle PS/2 lines stable [Elektroda, shg, post #2007210] • Typical PS/2 clock rate: 10–16 kHz [Intel, 1998].

What’s the simplest way to use one keyboard for two computers?

Buy a KVM (Keyboard-Video-Mouse) switch. It keeps each PC’s port active and avoids BIOS errors [Elektroda, cortez_, post #1969263] Even low-end units start at PLN 60 and bundle monitor and mouse switching too.

Which PS/2 pins actually need to be switched?

Only two: DATA (pin 1) and CLOCK (pin 5). Power (+5 V) and ground stay common [Elektroda, SanceS, #2006191; HardwareBook PS/2 Pinout].

Can I build a two-pole switch instead of a six-pole one?

Yes. Route DATA and CLOCK through a DPDT toggle or Isostat block. Leave +5 V, GND, and the two spare pins hard-wired to both PCs [Elektroda, nelik1987, post #2009996]

Will hot-switching harm the motherboard?

Risk is low but real. Some chipsets ignore re-plugs; others lock the port until reboot [Elektroda, jacekp123, post #2068109] Pull-ups and waiting until one PC fully boots reduce failure chances.

How do I wire a basic two-PC PS/2 keyboard switch?

  1. Solder DATA and CLOCK from the keyboard to the center poles of a DPDT.
  2. Connect each PC’s DATA and CLOCK to opposite throw contacts.
  3. Add 10 kΩ pull-ups on the inactive side. Done.

Why shouldn’t I power on both PCs at the same time?

During POST each BIOS polls for a keyboard. If only one sees DATA/CLOCK, the other shows “Keyboard error” and may halt [Elektroda, shg, post #2007210] Start one machine, flip the switch, then power the second.

What does an edge-case failure look like?

On some boards the mouse keeps working but the keyboard stays dead until shutdown, even after reconnection. This happens when CLOCK is pulled low too long [Elektroda, jacekp123, post #2068109]

Do KVMs support wireless USB keyboard–mouse combos?

Only USB-aware models do. A PS/2-only KVM needs adapters that split the receiver’s USB plug into separate PS/2 signals—often unreliable [Elektroda, Stefan Rodemzgór, post #2059250] Look for “USB HID” on the spec sheet.

Is USB switching easier than PS/2?

Yes. USB hubs handle hot-plugging natively. A single DPDT relay can auto-route 5 V and D± lines when one PC powers up [Elektroda, wader_669, post #1984647]

How much current can a PS/2 port supply?

Intel’s design guide allows up to 275 mA peak and 100 mA steady [Intel, 1998]. Stay within this if adding LEDs or relays.

What brands make reliable low-cost KVMs?

Aten CS-22U, UGREEN 2-Port, and Digitus DS-11900 all retail under US$25 and support hotkey switching [Product Sheets, 2024].
Generated by the language model.
ADVERTISEMENT