Back in the old days, when handing someone a DB serial cable when they asked for a DE serial cable would get you killed, KVM switchers were a thing. These devices were simple boxes with a few VGA ports, a few PS/2 ports, and a button or dial that allowed your input (keyboard and mouse) and output (video) to be used with multiple computers. Early KVMs were really just a big ‘ol rotary switch with far, far too many poles. Do you remember that PS/2 wasn’t able to be hot plugged? The designers of these KVMs never knew that.
Today, KVM switchers are a bit more complicated than a simple rotary switch. We’re not dealing with VGA anymore — we have HDMI muxes. We’re also not dealing with PS/2 anymore, and USB requires a bit of microelectronics to switch from one computer to another. For one of his many Hackaday Prize entries, [KC Lee] is designing a low-cost HDMI switch and USB mux. It works, it’s cheap, and if you need to switch a keyboard, mouse, and monitor between boxes, it’s exactly what you need.
First off, the HDMI switching. Designing a switch for HDMI would usually take some obscure parts, intricate routing, and a lot of prototyping time. [KC] found a way around this: just hack up a $5 HDMI switch. This cheap HDMI switch is as simple as it gets, with an HDMI mux doing the heavy lifting and an 8-pin microcontroller to handle the buttons and a selector LED.
For the USB, there are a few more design choices. For USB 1.x switching, [KC] figures he can get away with a 74HC4052 dual 4:1 analog mux. Yes, he’s doing digital with analog chips, the heathen. There are drawbacks to this: everything could break, and it’s only USB 1.x, anyway. For a USB 2.0 KVM, there are a few more professional options. The OnSemi NCN9252 is a proper USB 2.0 mux, and in the current design.
You might think that our community would always strive to be at the cutting edge of computing and use only the latest and fastest hardware, except for the steady stream of retrocomputing projects that appear. These minimalist platforms hark back to the first and second generation of accessible microcomputers, often with text displays if they have a display at all, and a simple keyboard interface to a language interpreter.
Often these machines strive to use the hardware of the day, and are covered with 74 logic chips and 8-bit processors in 40-pin dual-in-line packages, but there are projects that implement retrocomputers on more modern hardware. An example is [Sebastian]’s machine based upon a couple of PIC microcontrollers, one of which is an application processor with a PS/2 keyboard interface, and the other of which handles a VGA display interface. The application it runs calculates whether a 4-digit number is a prime and displays its results.
His write-up gives a fascinating overview of the challenges he found in creating a reliable VGA output from such limited hardware, and how he solved them. Though this one-sentence description makes a ton of work sound easy, horizontal sync pulses are generated as hardware PWM, and pixel data is streamed from the SPI bus. The VGA resolution is 640×480, upon which he could initially place a 10×10 block of text. Later optimizations extend it to 14×14.
Sometimes it’s not the power of the hardware but the challenge of making it perform the impossible that provides the attraction in a project, and on this front [Sebastian]’s retrocomputer certainly delivers. We’ve featured many other retrocomputers before here, some of which follow [Sebastian]’s example using modern silicon throughout, while others mix-and-match old and new.
If you got an old PC/XT stored somewhere in basement and want to use a newer keyboard, here’s a little project you might like. [Matt] built an AT2XT keyboard adapter on a prototype board using an AT to PS/2 keyboard cable. An AT2XT keyboard adapter basically allows users to attach AT keyboards to XT class computers, since the XT port is electronically incompatible with PC/AT keyboard types. For those retro computing fans with a lot of old PCs, this trick will be great to connect the XT machines to a KVM (keyboard/Video/Mouse) switch.
[Matt] found schematics for the project on the Vintage Computer Federation Forum, but used a PIC12F675 instead of the specified PIC12F629. He does provide the .hex file for his version but unfortunately no code. You could just burn the .hex file or head up to the original forum and grab all files to make your own version. The forum has the schematics, bill of materials, PCB board layout and firmware (source code and .hex), so you just need to shop/scavenge for parts and get busy.
And if you are felling really 31337, you can make a PS/2 version of the binary keyboard to justify the use of your new adapter.
Keeping track of your 3D-printer filament use can be both eye-opening and depressing. Knowing exactly how much material goes into a project can help you make build-versus-buy decisions, but it can also prove gut-wrenching when you see how much you just spent on that failed print. Stock filament counters aren’t always very accurate, but you can roll your own filament counter from an old mouse.
[Bin Sun]’s build is based around an old ball-type PS/2 mouse, the kind with the nice optical encoders. Mice of this vintage are getting harder to come by these days, but chances are you’ve got one lying around in a junk bin or can scrounge one up from a thrift store. Stripped down to its guts and held in place by a 3D-printed bracket, the roller that used to sense ball rotation bears on the filament on its way to the extruder. An Arduino keeps track of the pulses and totalizes the amount of filament used; the counter handily subtracts from the totals when the filament is retracted.
Simple, useful, and cheap — the very definition of a hack. And even if you don’t have a 3D-printer to keep track of, harvesting encoders from old mice is a nice trick to file away for a rainy day. Or you might prefer to just build your own encoders for your next project.
Continue reading “This Old Mouse Keeps Track of Filament Usage”
Evil geniuses usually have the help of some anonymous henchmen or other accomplices, but for the rest of us these resources are usually out of reach. [Evan], on the other hand, is on his way to a helpful army of minions that will do his bidding: he recently built a USB-powered minion that turns a regular PS/2 mouse and keyboard into a Bluetooth mouse and keyboard.
[Evan] found his minion at a McDonald’s and took out essentially everything inside of it, using the minion as a case for all of the interesting bits. First he scavenged a PS/2 port from an old motherboard. An Arduino Nano is wired to an HC-05 Bluetooth chip to translate the signals from the PS/2 peripherals into Bluetooth. The HC-05 chip is a cheaper alternative to most other Bluetooth chips at around $3 vs. $40 for more traditional ones. The programming here is worth mentioning: [Evan] wrote a non-interrupt based and non-blocking PS/2 library for the Arduino that he open sourced which is the real jewel of this project.
Once all the wiring and programming is done [Evan] can turn essentially any old keyboard and mouse into something that’ll work on any modern device. He also put an NFC tag into the minion’s head so that all he has to do to connect the keyboard and mouse is to swipe his tablet or phone past the minion.
If you’re looking for an interesting case for your next project, this McDonald’s Minion toy seems to be pretty popular. PS/2 keyboards are apparently still everywhere, too, despite their obsolescence due to USB. But there are lots of other ways to get more use out of those, too.
Continue reading “Minions Turn Your Keyboard into a Bluetooth Keyboard”
Hacking for the Raspberry Pi Zero is a tricky proposition. Whatever you do, you’re working with a nominal five dollar board, so your hacks can’t be too highfalutin. For instance, a decent PS/2 to USB adapter will cost you as much as the Zero did, if not more. But if you just need to drive your Pi Zero from your old Model M (we hear you!) you’ve got to do it on the cheap.
So when prolific Pi hacker [mincepi] set out to build a PS/2 adapter, some corners were cut. PS/2 is a clocked data protocol, but the good news is that the clock doesn’t start and stop all the time as in I2C or SPI. This means that if you poll the data line at just the right frequency, at least in principle you’ll be able to ignore the clock.
So that’s what [mincepi] did. As you can see in the schematic and the banner image, there’s nothing to it. Two resistors provide the pullup voltage for the clock and data lines. And here’s a gem: a green LED with a drop voltage of about 2 V converts the 5 V data line down to something that the Pi Zero’s 3.3 V won’t get fried with. Cute, and very much in keeping with the spirit of the hack. You might be tempted to scrounge up a 3.3 V zener diode from somewhere just to be on the safe side, but remember, it’s a five dollar computer you’re protecting.
The last piece is a custom kernel module for the Pi that polls the PS/2 data line at just the right frequency. If you’re not a Linux person and “compiling a kernel module” sounds scary, [mincepi] has even put together a nice guide for the Raspbian distribution that he’s using. It should work with minor tweaks for any other distro.
We said [mincepi] is a prolific Pi hacker and here’s the proof: we’ve covered his quick-and-dirty VGA output hack and a scheme to get analog sound input into the Pi Zero just in the last couple of weeks. Hack on!
A lot of people can bake a cake. Sort of. Most of us can bake a cake if we have a cake mix. Making a cake from scratch is a different proposition. Sure, you know it is possible, but in real life, most of us just get a box of cake mix. The Raspberry Pi isn’t a cake (or even a pie), but you could make the same observation about it. You know the Raspberry Pi is just an ARM computer, you could program it without running an available operating system, but realistically you won’t. This is what makes it fun to watch those that are taking on this challenge.
[Deater] is writing his own Pi operating system and he faced a daunting problem: keyboard input. Usually, you plug a USB keyboard into the Pi (or a hub connected to the Pi). But this only works because of the Linux USB stack and drivers exist. That’s a lot of code to get working just to get simple keyboard input working for testing and debugging. That’s why [Deater] created a PS/2 keyboard interface for the Pi.
Even if you aren’t writing your own OS, you might find it useful to use a PS/2 keyboard to free up a USB port, or maybe you want to connect that beautiful Model-M keyboard without a USB adapter. The PS/2 keyboard uses a relatively simple clock and data protocol that is well-understood. The only real issue is converting the 5V PS/2 signals to 3.3V for the Pi (and vice versa, of course).
Continue reading “PS/2 Keyboard for Raspberry Pi”