Decoding The PS/2 Keyboard Protocol Using Good Old Fashioned Hardware

1987 was a glorious year.  It brought us the PS/2 keyboard standard that’s still present on many a motherboard back panel to this day. (It also marked the North America/Europe release of The Legend of Zelda but that’s another article.) Up until this point, peripherals were using DIN-5 and DE-9 (often mistakenly called DB9 and common for mice at the time) connectors or — gasp — non-standard proprietary connectors. So what was this new hotness all about? [Ben Eater] walks us through the PS/2 hall of fame by reverse-engineering the protocol.

The PS/2 connector in all its glory

This is a clocked data protocol, so a waveform is generated on the data pin for each key pressed that can be compared to the clock pin to establish the timing of each pulse. Every key sends a unique set of encoded pulses and voila, the whims of the user can quickly and easily be decoded by the machine.

This is where [Ben’s] dive really shines, we know he’s a breadboarding ninja so he reaches for some DIP chips. A shift register is an easy way to build up a parallel PS/2 interface for breaking out each data packet. There are a few quirks along the way, like the need to invert the clock signal so the shift register triggers on the correct edge. He also uses the propagation delay of a couple inverter gates to fire the 595 shift register’s latch pin slightly late, avoiding a race condition. A second 595 stores the output for display by a set of LEDs.

Beyond simply decoding the signal, [Ben] goes into how the packets are formatted. You don’t just get the key code, but you get normal serial interface error detection; start/stop bits and a parity bit as well. He even drills down into extended keys that send more than one packet, and a key-up action packet that’s sent by this particular keyboard.

This is the perfect low-level demo of how the protocol functions. On the practicality side, it feels a bit strange to be breaking out the serial to parallel when it would be very easy to monitor the two signal lines and decode them with a microcontroller. You might want to switch it up a bit, stick with the clock and data pins, but connect them to a Raspberry Pi using just a few passive components.

Continue reading “Decoding The PS/2 Keyboard Protocol Using Good Old Fashioned Hardware”

Launching An Open Source Keyboard; System76 Has Published Their Design Files

System76, a computer manufacturer known for selling machines which run Linux, recently unveiled the complete sources for their forthcoming Launch mechanical keyboard. Made with familiar tools, mass produced, and backed by a stable company it looks like the Launch will be a compelling entrant into the world of mechanical keyboards.

Back in March of 2020 System76 published a blog post about a new project they were embarking on; a mechanical keyboard with an unusual layout. At the time there was scant information available besides a summer 2021 target and little was heard until last week when they opened up access to the Launch repository. Everything should be recognizable if you’ve ever looked at the sources for a customized mechanical keyboard before, which is what gets our attention. Electrical sources are authored with KiCad and should be easy to tweak or fabricate. And mechanical components are provided in STEP files with mechanical drawings, presumably because they intend to actually manufacture these.

launch-chassis.pngFeature wise all the usual hallmarks of a well designed keyboard are here. The Launch uses hostswap sockets to make it easy to install the usual Cherry MX compatible switch options, and includes per-key RGB backlighting courtesy of SK6805 LEDs. The ATmega32U4 runs the popular and extremely capable QMK firmware instead of something bespoke, so it should be easy to customize to the user’s desire.

System76 touts an unusual key layout, but if you’ve seen a 75% keyboard before it shouldn’t be too threatening (though we do wonder about that shrunken right shift). The most unusual feature is that it features a USB hub capable of full speed 10 gigabit USB 3.1 Gen 2 on two USB-C and two USB-A ports. It’s worth checking out the schematic to appreciate how much more complicated the hub design is than the rest of the keyboard, which is practically vestigial in comparison.

The remaining unknown is how the Launch integrates with Pop!_OS, System76’s awkwardly named remix of Ubuntu. They promise deep, compelling integration and we’re excited to see how that manifests.

This Negative Reinforcement Keyboard May Shock You

We wouldn’t be where we are today without Mrs. Coldiron’s middle school typing class. Even though she may have wanted to, she never did use negative reinforcement to improve our typing speed or technique. We unruly teenagers might have learned to type a lot faster if those IBM Selectrics had been wired up for discipline like [3DPrintedLife]’s terrifying, tingle-inducing typist trainer keyboard (YouTube, embedded below).

This keyboard uses capsense modules and a neural network to detect whether the user is touch-typing or just hunting and pecking. If you’re doing it wrong, you’ll get a shock from the guts of a prank shock pen every time you peck the T or Y keys. Oh, and just for fun, there’s a 20 V LED bar across the top that is supposed to deter you from looking down at your hands with randomized and blindingly bright strobing light.

Twenty-four of the keys are connected in groups of three by finger usage — for example Q, A, and Z are wired to the same capsense module. These are all wired up to a Raspberry Pi Zero along with the light bar. [3DPrintedLife] was getting a lot of cross-talk between capsense modules, so they solved the problem in software by training a TensorFlow model with a ton of both proper and improper typing data.

We love the little meter on the touchscreen that shows at a glance how you’re doing in the touch typing department. As the meter inches leftward, you know you’re in for a shock. [3DPrintedLife] even built in some games that use pain to promote faster and more accurate typing. Check out the build video after the break, but don’t say we didn’t warn you about the strobing lights.

The secret to the shock pen is a tiny flyback transformer like the kind used in CRT televisions. Find a full-sized flyback transformer and you can build yourself a handheld high-voltage power supply.

Continue reading “This Negative Reinforcement Keyboard May Shock You”

Two-Key Keyboard Build Log Starts Small, But Thinks Big

Interested in making a custom keyboard, but unsure where to start? Good news, because [Jared]’s build log for an adorable “2% Milk” two-key mini-keyboard covers everything you need to know about making a custom keyboard, including how to add optional RGB lighting. The only difference is that it gets done in a smaller and cheaper package than jumping directly in with a full-size DIY keyboard.

[Jared] is definitely no stranger to custom keyboard work, but when he saw parts for a two-key “2% Milk” keyboard for sale online, he simply couldn’t resist. Luckily for us, he took plenty of photos and his build log makes an excellent tutorial for anyone who wants to get into custom keyboards by starting small.

The hardware elements are clear by looking at photos, but what about the software? For that, [Jared] uses a Teensy  Pro Micro clone running QMK, an open source project for driving and configuring custom input devices. QMK drives tiny devices like the 2% Milk just as easily as it does larger ones, so following [Jared]’s build log therefore conveys exactly the same familiarity that would be needed to work on a bigger keyboard, which is part of what makes it such a great project to document.

Interested in going a little deeper down the custom keyboard rabbit hole? You can go entirely DIY, but there’s also no need to roll everything from scratch. It’s possible to buy most of the parts and treat the project like a kit, and Hackaday’s own [Kristina Panos] is here to tell you all about what that was like.

AT Keyboard Becomes Child’s Speaking Toy

Just as cats find sitting on a keyboard to be irresistible, so do children find pressing their keys. After throwing some ideas around with other parents, [Peter] came up with the idea of transforming an old AT  keyboard into a learning toy by making each key press “speak” its corresponding letter.

The donor keyboard is a nondescript late-80s AT compatible PC. Before readers imagine that a sought-after mechanical ‘board is being defiled, these were manufactured in their millions back then with exactly the same lackluster actions as modern cheap input devices. This one had plenty of space inside for an Arduino Nano that emulates an AT keyboard host and plays WAV file samples from an SD card to one of its PWM outputs. An op-amp low pass filter cleans up the noise from this rudimentary DAC, and feeds a little speaker through an audio amplifier. The keyboard supports both male and female voices, as well as a piano.

Hours of juvenile fun will no doubt result, but we can’t help wondering whether this could become the bane of a parent’s life in the manner of so many other noise-producing toys. Meanwhile, [Peter]’s work has graced these pages in the past, most recently with an automatic cooker hood.

Logitech Joystick Gets A Mechanical Sidekick

The mechanical keyboard rabbit hole is a deep one, and can swallow up as much money and time as you want to spend. If you’ve become spoiled on the touch and responsiveness of a Cherry MX or other mechanical switch, you might even start putting them on other user interfaces as well, such as this Logitech joystick that now sports a few very usable mechanical keys for the touch-conscious among us.

The Logitech Extreme 3D Pro that [ErkHal] and friend [HeKeKe] modified to accept the mechanical keys originally had a set of input buttons on the side, but these were unreliable and error-prone with a very long, inconsistent push. Soldering some mechanical switches directly on the existing board was a nice improvement, but the pair decided that they could do even better and rolled out an entire custom PCB to mount the keys more ergonomically. The switches are Kailh Choc V2 Browns and seem to have done a great job of improving the responsiveness of the joystick’s side buttons. If you want to spin up your own version, they’ve made the PCBs available on their GitHub page.

While [ErkHal] notes the switches aren’t the best and were only used since they were available, they certainly appear to work much better than what the joystick shipped with originally. In fact, we recently saw similar switches used to make a custom mechanical keyboard made for the PinePhone.

Adaptive Macro-Pad Uses Tiny OLED Screens As Keycaps

When we first laid eyes on Keybon, the adaptive macro keyboard, we sort of wondered what the big deal was. It honestly looked like any other USB macro keyboard, with big icons for various common tasks on the chunky keys. But looks can be deceiving, and [Max Kern] worked a couple of surprises into Keybon.

First of all, each one of Keybon’s buttons is actually a tiny OLED display, making the keycaps customizable through software. Each of the nine 0.66″ displays has a resolution of 64 x 48 pixels, which is plenty for all kinds of icons, and each is mounted over an SMD pushbutton switch. He had to deal with the problem of the keycaps just wobbling around atop the switch button without depressing it; this was solved with a 3D-printed cantilever frame that forced the keycaps to pivot only in one axis, resulting in clean, satisfyingly clicky keypresses.

The other trick that Keybon has is interactivity. By itself, it boots up with a standard set of icons and sends the corresponding keystrokes over USB. But when used with its companion Windows application, the entire macro set can be switched out to accommodate whatever application is being used. This gives the users access to custom macros for a web browser, EDA suite, CAD applications, or an IDE. The app supports up to eight macro sets and can be seen in action in the video below.

We love the look and the functionality [Max.K] has built into Keybon, but we wonder if e-ink displays would be a good choice for the keycaps too. They’re available for a song as decommissioned store shelf price tags now, and they might be nice since the icon would persist without power.

Continue reading “Adaptive Macro-Pad Uses Tiny OLED Screens As Keycaps”