Categories
Tech Explorations

Business in the front, party in the back: optimizing desktop setups for multi-PC applications

I recently started a new job as a network engineer and with it I got my first work laptop: a fairly decent Lenovo ThinkPad T14, and while I am a fan of portability and uncluttered workspaces, I much prefer to use external input devices along with a second monitor, especially if it is where I usually work.

Luckily I do have all of these things, a nice keyboard, a big 4K monitor, and a very smooth trackball (come on, you’ve read my articles already, you know I’m a weirdo like that). They are however connected to my personal laptop, and I don’t have a big enough desk (or wallet, for that matter) to duplicate it all. Some sharing is in order.

In my desperation, I reorganized my desk with the help of a few gizmos, which allows me to quickly switch my input devices and monitors between laptops, while maintaining independence between both systems, and in a way that doesn’t turn me absolutely crazy. This is how I did it.

Problems, half measures, and a sore back

My job is essentially entirely remote: I’m basically half front-end developer, half tech support; I answer emails, read and compose docs, stare at code, and participate in meetings. Since I didn’t have much experience in having two computers, I just plopped it next to my big rig and just went to work for a couple of days. Immediately, many problems appeared:

  • My back was sore: Laptops on desks usually have you facing downwards at the screen, and since it’s a small screen and a big desk, my back was certainly feeling it.
  • Laptop keyboards and trackpads are a pain in the long run: they are small, key travel is tiny, and they usually don’t have a numpad. The T14 certainly has one of the better keyboards in the market right now, but an actual key switch would be much better. The trackpad is certainly good (especially with its hardware buttons on top), but it’s fairly small and cramped (and don’t even get me started on the ThinkPad Nippleā„¢). Also, raising your computer up to eye level makes them even harder to use.
  • Limited screen real-estate: the screen is a 1920×1080 IPS 14-inch display, which is great, but it’s small: the scaling has to be big in order for text to be legible and being accustomed to dual-monitor setup just made it a pain overall.

Because all of my current setup works with a single USB-C port (more on that later) I just put my work laptop on my stand and used it like that for a while, but that quickly made evident that switching devices all day was going to be a messy and non productive solution. What are my choices here?

Well, I could just use my personal laptop for work, but that is a recipe for disaster: mixing business and pleasure in general is a bad idea for privacy and security reasons, but there’s also other security measures in my work device that would make it difficult, if not impossible, to get everything running as it should.

I then turned to the idea of using the laptop as a pivot computer: it just sits in a corner chugging away and I just have to open a Remote Desktop Connection to it: RDP has a sophisticated feature set including device and clipboard sharing, bidirectional audio for calls, the works. This seemed like a great idea, I could share all of my devices on my personal computer to my work computer and everything would be sorted, right?

Not so fast. My work device runs Windows and you can go to Settings and enable RDP, but the real problem was Active Directory: all of my login data is on a company server to which I have no access to, and the Remote Desktop Server on my just refused to play ball with it: I got certificate issues, authentication issues, connection issues, and I just couldn’t get it to work. If this was Windows Server, I could probably massage the service enough to make it work, but it isn’t, and it’s probably for the better: if a remote desktop is compromised, you can cause catastrophic damage on everything you have access to, as the device doesn’t really distinguish between a remote session and a local one, so back to the drawing board it was.

I tried other solutions, but they all failed in one way or another: switching inputs on my monitor? Doesn’t solve the device problem. Other remote desktop protocols like VNC or AnyDesk? either they didn’t have device support or I had to pay subscriptions, along with having to install unauthorized software on my laptop, a big no-no.

My only recourse was hardware: a dedicated device handles sharing and switching devices between computers, while the target computers are none the wiser. But how was I to implement this and have it play ball with my current setup?

My previous setup

My personal laptop is an HP Victus 16, sporting quite a few peripherals:

  • Logi G513 Carbon with MX Brown switches and custom keycaps. (over USB)
  • Kensington Trackball Expert wireless pointer device. (over USB)
  • Dell S2721QS 4K 21-inch monitor running at 1440p for better performance.
  • Behringer XENYX 302USB audio interface (over USB)
  • Gigabit Ethernet over USB from my dock.

This setup has my laptop screen as the main display, with the monitor over to the side, with all devices connected via a USB-C dock. This allows me to have everything connected with just two cables (the other one being a power supply, being a “gamer” model with high power consumption). I really like docks for their flexibility, and with USB-C native video transport and the high speed USB 3 data link, I can switch from on-the-go to static and vice versa in mere seconds, all while having hidden cables and reduced clutter.

This is very much a tangent, but I’ve always found docks the coolest thing ever. Ever since I saw an OG IBM ThinkPad in my dad’s office desktop rocking Windows XP and a massive dock back in like 2006 I’ve appreciated the massive advantages in commodity and portability. My first laptop had a massive dock connector on the side, and USB-C has finally given me the possibility of running power, video, and data over a single cable. If you have a laptop sitting semi-permanently in your desk, I highly recommend you get one. Sure, laptops are loud and underpowered compared to equivalent desktop PCs, but if you need portability, it doesn’t really get much better than this.

I’ve been using a Baseus Metal Gleam 6-in-1 USB-C dock: they have 3 USB 3.0 ports, USB-PD passthrough, an HDMI output, and a Gigabit Ethernet port. It’s enough for my needs and are also small, which meant I could mount it directly to the stand the laptop sits on top of.

Now I had to decide on a new layout: how exactly was I going to place two laptops and a monitor in my desk without losing all my space?

Introducing the KVM

Having all of these in mind, these were my objectives:

  • The monitor will now become the primary screen, switching between devices as needad.
  • The keyboard and mouse must switch between laptops in sync with the screen.
  • I need to hear the audio of both computers simultaneously, although the main one would be the personal one.
  • Whatever device does the switching must have some sort of remote, in order to hide it under the desk for better cable management.

For my work computer, I just duplicated my setup for my personal computer: a laptop stand and another of those USB-C dock things. The audio situation was also simple, as the Behringer audio interface I’m using has a secondary stereo output called 2-TRACK. using a simple USB sound card, a ground loop isolator (for preventing buzzing sounds) and some random 3.5mm to RCA audio cable I had both devices in my headphones without issue.

For the screen and the USB devices, I needed a KVM switch: a clunky acronym standing for Keyboard-Video-Mouse, it’s exactly what it sounds like: you press a button, and your keyboard, mouse, and monitor are now connected to another machine. These are fairly niche devices mostly relegated to server racks and other specialized applications, but they can still be found for cheap in the power user electronics market.

I got a UGREEN CM664 HDMI-USB KVM switch from AliExpress for cheap, and despite it’s low price it has everything I need: HDMI video switching, USB 3.0 switching, and a cute little wired remote perfect for adding to my keyboard. It’s also fairly small, only big enough to fit all the large connectors, and requires no software, it’s just an HDMI pass-through and a USB hub that can switch devices.

Not to get too deep into the weeds in here, but this device physically disconnects all the interfaces during switching. This means devices have to be recognized and initialized, and a second screen must be instantiated and all windows reordered, something that takes a couple of seconds in total. This is not a problem for me, but there are some KVM switches that emulate the presence of a device while another computer is active in order to make the transition almost seamless, but that seemed a bit excessive for this application, especially for the considerable price hike.

Now it’s just a matter of hooking up everything together and we’re done, right?

A cable management nightmare

Well, not so fast. You may have noticed there’s a lot of cables in the mix: tons of USB cables, network cables, audio cables, power bricks, the whole shebang. If not kept in check, this could quickly become a giant octopus of messy cables that can quickly eat up desk space and just flat out look ugly.

My desk also has some storage underneath that must be able to be slid out, so it’s flat out not an option to have cables dangling behind it. To solve this I just used zip ties and a clever twist on the usual mounting clips: I really wish those plastic mounts with adhesive backing worked: I really like them, but having cables pulling permanently on a piece of double sided tape just guarantees they’ll pop off at some point.

A better solution for me was a box of short washer-head screws: the wider head makes it easy to grab a zip tie under it, while being discreet enough to grab a bunch of cables without pulling out. Granted, you’re putting holes in your furniture, but I have found time and again that it is a worthwhile sacrifice in order for the cables to stay put for long periods of time. The screws are also reusable: just back them out a turn or two and the zip tie will come right out.

Once I got my enormous bundle of cables under control, it was time to test it out.

Performance and quirks

Overall, the whole thing works great: I can quickly switch between both laptops, sharing devices without an issue. I attached the remote to a corner of my laptop, which gives me a clean look and easy access to it. The switching is fairly quickly and all apps quickly rearrange when the second display is detected, which is very useful when returning to a computer after a switch. Also, having the laptop screen still showing is great for situational awareness when you’re working with both laptops at the same time. The entire setup uses slightly more space than it used to, but it’s a marginal difference in comparison to all of the advantages it has brought.

I thought having shared audio for both devices would be a bit of a mess, but surprisingly no: hearing notifications from the other computer while playing music or keeping a call going while switching computers is extremely useful, and the expected overlap of sounds have turned out to not really be a problem.

The KVM switching process, with it’s rediscovery and rearrangement of devices and applications, takes a couple of seconds, but it isn’t really a problem, at least for my sensibilities. I do wish the KVM had some sort of optimization for preventing the lag in USB devices, which I feel is slightly too much.

There is also the problem of sleep: you have to tweak your settings to prevent the computers from going to sleep while you’re looking at them: since it’s very much possible that I’m not interacting with the device for a while, it’s not an unreasonable assumption that the device is ready to sleep, even if it isn’t.

Closing thoughts

Overall, this KVM solution has pretty much solved all my problems of parallel laptops: the devices are shared without a problem, and my desk has not been entirely consumed in the process. There are some quirks, but overall the device does exactly what it should.

I do feel however that it’s very involved process: as work-from-home gets turned into an ubiquitous form of labor, I fell that a hardware solution that just does this for you, with some degree of ability for customization, could be a real game changer for all of us in this situation. This is a thing that should be so much easier, but it just isn’t, and there aren’t many approaches in the market that don’t require this kind of tinkering, but if you are so inclined, you can make it work.

I just hope I never see the day when a third computer has to be integrated.

Categories
Tech Explorations

Building a lab-grade power supply from old computer parts

A bench power supply is a fundamental tool for testing electronics, allowing for flexible power delivery to a range of different devices that could make their way to your bench. As electronics became ubiquitous DC power supplies have become easy to find, building capable devices from scrap electronics becomes a very budget friendly way to expand the capabilities of your setup.

I’m not beating around the bush: this isn’t how to make a fully-featured power supply for cheap, it’s a hacky, cobbled together device that could be so much more powerful, but I just don’t want it to: it’s just so I can charge batteries, power junk on to see if it works, and just get some voltages out to the world when I’m too lazy to go get a power brick. It’s ugly and profoundly utilitarian, but it works.

I’ve got a ton of ATX power supplies, and you probably do too

I’m willing to bet that when IBM launched the PC AT in 1984, they didn’t expect that it’s overall layout and design would become the de facto standard for computers, especially forty years later. One would be forgiven for questioning how we came to this predicament: there are many things to hate about the AT standard: The card risers are barely adequate for holding modern GPUs, the power supplies are way too bulky and have a rats nest of wires that you may not need, the connectors suck, and so, so much more. However, it is what stuck, so we’re stuck with it too.

This means that pretty much every desktop computer that has a tower form factor has an ATX (AT eXtended, basically a beefed up AT standard for slightly less crap and more modern applications) compatible power supply and pretty much everything is more or less in the same place inside the chassis, which makes it great for finding parts that more or less all work with each other.

If you’ve ever disassembled a desktop computer (and let’s face it, if you’re reading this you probably have), you probably ended up throwing the PSU into a pile of them that you look at every so often thinking “I should probably do something with them”; well, here we are.

Contemporary power supplies usually have a few components in common:

  • A 24-pin motherboard connector. (+3.3V, +5V, +12V, -12V, 5Vsb)
  • A 4 or 8-pin processor connector. (+12V)
  • A PCIe power connector, either 6-8 pins, with higher power models having multiple connectors. (+12V)
  • Accessory connectors, usually SATA and/or Molex connectors, for stuff like storage drives, optical drives, fans, etc. (+5V, +12V)

These devices are extraordinarily dumb: while the motherboard does have some control over its operation, the protocol is extremely simple: a +5V standby signal powers the control circuitry, which turns on the supply by pulling the PWR_ON line to ground, and it is notified that the PSU is ready to go when the PG line is pulled to +5V. That’s it. The wide array of voltages and simple communications make these supplies an exceptional way of powering almost everything. Almost.

Most bench power supplies are adjustable, having both voltage and current control over a wide range of supply conditions, which is very handy to get that pesky device that uses a weird voltage to power up, or even running tests under different conditions. There could be ways of modifying the feedback circuitry of the switchmode power supply inside, but I’m not knowledgeable enough in electronics to know how to do so, and from what I’ve seen, it might not even be possible.

Some jellybean parts from AliExpress, a box, and some soldering later

With all these factors taken into account, the requirements are as follows:

  • I want to use a ATX power supply from an old computer.
  • I want all the voltages from the ATX standard available for use.
  • I want an adjustable regulator that can do both Buck and Boost, so I can get a wide range of voltages.
  • The regulator must have both constant voltage (CV) and constant current (CC) capabilities.
  • Having two regulators would be nice.
  • The power supply must be at least 150W total.

From my pile of scrap I fished out a FSP 250-60HEN 250W ATX power supply. It’s fairly old, but it has a couple features I like:

  • It has a big fan on the top, which makes it quieter.
  • It has two 12V rails: one for the processor connector, another for everything else.
  • the wire gauges are all fairly similar, which makes it easier to bundle afterwards.

With this, I cut off all connectors and separated the rails: orange is +3.3V, red is +5V, yellow is +12V, the lonely blue wire is -12V, black is ground, and all the status cables (green for power on, gray for power good, purple for +5Vsb, and a ground for making it all work) were separated by color and soldered to ring terminals for connecting to banana plugs on the front. The +12V rail from the processor connector was also kept apart. Some cheap binding post/banana plug combos from AliExpress and a heinous 3D print job that peeled off from the print bed halfway through, and I had some voltages to work with. The power on signal went to a toggle switch that connected it to ground (this is my main power switch), the 5Vsb went to an indicator to show the device has AC power, and the power good lights up another indicator to show the device is ready to be used.

For the regulators, I went for some nifty panel mount regulators I found on AliExpress for cheap: they can handle a decent amount of power, they have a usable interface, and they have an extensive range: they can to 0-36V at 0-5A, and all from the second +12V rail. Pretty cool! Add some banana plug cables, alligator clips, some other accessories, a couple of zipties, aluminum tape, and some swearing later, we have a supply!

Ups and downs

I’m not going to sugar coat this: this is a quick and dirty project. The thing is ugly, it looks like it’s going to kill you, and it very much gives a “rough around the edges” vibe to it, but it works exactly as I had hoped for: the regulators work great, the fixed voltages are no problem, and all the control devices work as they should. There are a few things worth noting though:

  • The regulators have an interesting way of performing constant-current duties: instead of some sort of control loop to keep the current stable along a desired value, the devices just shoves whatever voltage you gave it and then it observes; it changes the output voltage to give a current lower than your target and then measures again, reaching your desired current in steps. This perturb-and-observe model is very much useful for steady-state applications, but if you have sensitive electronics like LEDs or integrated circuits, be mindful to set your voltage to a safe level before activating the CC mode, failing to do so could result in an unsafe voltage in your terminals.
  • The measurements from the regulators are accurate, but not perfect, if you need precision, use a multimeter and short leads.
  • The fixed outputs have no onboard measurement other than what is needed for protection, so be careful about shorting these out.
  • I messed up the settings on my print and it came out really deformed. If I wasn’t lazy, I’d redo them with better adhesion to the bed, but I’m not. Nothing that some tape won’t solve. I might change them later, but the thought of undoing all the binding posts makes me queasy of doing it.

Overall, it’s like having a cheap AliExpress power supply, for about a quarter of the price. Pretty good overall, I’d say.

The tools you have are better than the tools you don’t

I’ve been working with this for about a month now, and I wonder how I made it this far without a bench power supply. Building my own tools gives me tons of satisfaction, and I hope to keep using and improving this device in the future. Sometimes the tools you can build with what you have is the best tool you can possibly get, and it will probably get you farther than waiting for the shiniest gadget.

So yeah, if you have a pile of junk computer parts, build a power supply! you’ll get lots of mileage from it and it will open lots of doors in your electronics adventures, not to mention the money it’ll save you.

Get building!