Human-Interfacing Devices: HID Over I2C

In the previous two HID articles, we talked about stealing HID descriptors, learned about a number of cool tools you can use for HID hacking on Linux, and created a touchscreen device. This time, let’s talk about an underappreciated HID standard, but one that you might be using right now as you’re reading this article – I2C-HID, or HID over I2C.

HID as a protocol can be tunneled over many different channels. If you’ve used a Bluetooth keyboard, for instance, you’ve used tunneled HID. For about ten years now, I2C-HID has been heavily present in laptop space, it was initially used in touchpads, later in touchscreens, and now also in sensor hubs. Yes, you can expose sensor data over HID, and if you have a clamshell (foldable) laptop, that’s how the rotation-determining accelerometer exposes its data to your OS.

This capacitive touchscreen controller is not I2C-HID, even though it is I2C. By [Raymond Spekking], CC-BY-SA 4.0
Not every I2C-connected input device is I2C-HID. For instance, if you’ve seen older tablets with I2C-connected touchscreens, don’t get your hopes up, as they likely don’t use HID – it’s just a complex-ish I2C device, with enough proprietary registers and commands to drive you crazy even if your logic analysis skills are on point. I2C-HID is nowhere near that, and it’s also way better than PS/2 we used before – an x86-only interface with limited capabilities, already almost extinct from even x86 boards, and further threatened in this increasingly RISCy world. I2C-HID is low-power, especially compared to USB, as capable as HID goes, compatible with existing HID software, and ubiquitous enough that you surely already have an I2C port available on your SBC.

In modern world of input devices, I2C-HID is spreading, and the coolest thing is that it’s standardized. The standardization means a lot of great things for us hackers. For one, unlike all of those I2C touchscreen controllers, HID-I2C devices are easier to reuse; as much as information on them might be lacking at the moment, that’s what we’re combating right now as we speak! If you are using a recent laptop, the touchpad is most likely I2C-HID. Today, let’s take a look at converting one of those touchpads to USB HID.

A Hackable Platform

Continue reading “Human-Interfacing Devices: HID Over I2C”

An In-Depth Look At The Haptic Smart Knob

At Hackaday, we love those times when we get a chance to follow up on a project that we’ve already featured. Generally, it’s because the project has advanced in some significant way, which is always great to see. Sometimes, though, new details on the original project are available, and that’s where we find ourselves with [Scott Bez] and his haptic smart knob project.

Alert readers may recall [Scott]’s announcement of this project back in March. It made quite a splash, with favorable comments and a general “Why didn’t I think of that?” vibe. And with good reason; the build quality is excellent, and the idea is simple yet powerful. By attaching a knob to the shaft of a brushless DC motor and mounting a small circular LCD screen in the middle, [Scott] came up with an input device that could be reprogrammed on the fly. The BLDC can provide virtual detents at any interval while generating haptic feedback for button pushes, and the LCD screen can provide user feedback.

But how is such a thing built? That’s the subject of the current video, which has a ton of neat design details and build insights. The big challenge for [Scott] was supporting the LCD screen in the middle of the knob while still allowing the knob — and the motor — to rotate. Part of the solution was, sadly, a hollow-shaft motor that was out of stock soon after he released this project; hopefully a suitable replacement will be available soon. Another neat feature is the way [Scott] built tiny strain gauges into the PCB itself, which pick up the knob presses that act as an input button. We also found the way button press haptics are provided by a quick jerk of the motor shaft very clever.

This is one of those projects that seems like a solution waiting for a problem, and something that you’d build just for the coolness factor. Hats off to [Scott] for following up a sweet build with equally juicy details.

Continue reading “An In-Depth Look At The Haptic Smart Knob”

Python Your Keyboard Hack Chat With Adafruit

Join us on Wednesday, July 21 at noon Pacific for the Python Your Keyboard Hack Chat with the Adafruit crew!

Especially over the last year and a half, most of us have gotten the feeling that there’s precious little distinction between our computers and ourselves. We seem welded together, inseparable even, attached as we are day and night to our machines as work life and home life blend into one gray, featureless landscape where time passes unmarked except by the accumulation of food wrappers and drink cans around our work areas. Or maybe it just seems that way.

Regardless, there actually is a fine line between machine and operator, and in most instances it’s that electromechanical accessory that we all love to hate: the keyboard. If you buy off the shelf, it’s never quite right — too clicky, not clicky enough, wrong spacing, bad ergonomics, or just plain ugly design. The only real way around these limitations is to join the DIY keyboard crowd and roll your own, specifically customized to your fingers and your needs — at least until you realize that it’s not quite perfect, and need to modify it again.

Hitting this moving target is often as much a software problem as it is a hardware issue, but as is increasingly the case these days, Python is ready to help. To go into depth on how Python can be leveraged for the custom keyboard builder, our good friends at Adafruit, including Limor “Ladyada” Fried, Phillip Torrone, Dan HalbertKattni Rembor, and Scott Shawcroft will stop by the Hack Chat. We suspect they’ll have some cool stuff to show off, in addition to sharing their tips and tricks for making DIY keyboards just right. If you’re building custom keebs, or even if you’re just “keyboard curious”, you won’t want to miss this one.

join-hack-chatOur Hack Chats are live community events in the Hackaday.io Hack Chat group messaging. This week we’ll be sitting down on Wednesday, July 21 at 12:00 PM Pacific time. If time zones have you tied up, we have a handy time zone converter.

Retro Recreations Hack Chat With Tube Time

Join us on Wednesday, March 17 at noon Pacific for the Retro Recreations Hack Chat with Tube Time!

join-hack-chatNostalgia seems to be an inevitable consequence of progress. Advance any field far enough into the future, and eventually someone will look back with misty eyes and fond memories of the good old days and start the process of turning what would qualify as junk under normal conditions into highly desirable collectibles.

In some ways, those who have been bitten by the computer nostalgia bug are lucky, since the sheer number of artifacts produced during their period of interest is likely to be pretty high, making getting gear to lovingly restore relatively easy. But even products produced in their millions can eventually get difficult to find, especially once they get snapped up by eager collectors, leaving the rest to make do or do without.

Of course, if you’re as resourceful as Tube Time is, there’s another alternative: build your own retro recreations. He has embarked on some pretty intense builds to recapture a little of what early computer enthusiasts went through trying to build useful machines. He has built replicas of early PC sound cards, like an ISA-bus AdLib card, its MCA equivalent, and the “Snark Barker”— or is it the “Snood Bloober”? — which bears an uncanny resemblance to the classic Sound Blaster card from the 1980s.

Tube Time will join us for the Hack Chat this week to answer questions about all his retro recreations, including his newest work on a retro video card. Be sure to bring your questions on retro rebuilds, reverse engineering, and general computer nostalgia to the chat.

Our Hack Chats are live community events in the Hackaday.io Hack Chat group messaging. This week we’ll be sitting down on Wednesday, March 17 at 12:00 PM Pacific time. If time zones have you tied up, we have a handy time zone converter.

Click that speech bubble to the right, and you’ll be taken directly to the Hack Chat group on Hackaday.io. You don’t have to wait until Wednesday; join whenever you want and you can see what the community is talking about.
Continue reading “Retro Recreations Hack Chat With Tube Time”

Peripheral Doesn’t Need Deskspace

Some of us are suckers for new hardware. There’s absolutely nothing shameful about a drawer overflowing with gamepads, roll-up keyboards, and those funny-shaped ergonomic mice. MyTeleTouch won’t sate your itch for new hardware because [Dimitar Danailov] didn’t design hardware you hold, because it uses your phone as a catch-all Human Interface Device, HID. A dongle plugs into a standard USB port, and your Android phone can emulate a USB keyboard, mouse, or gamepad over Bluetooth.

Chances are high that you already set up your primary computer with your favorite hardware, but we think we’ve found a practical slant for a minimalist accessory. Remember the last time you booted an obsolete Windows desktop and dug out an old mouse with a questionable USB plug? How long have you poked around the bottom of a moving box trying to find a proprietary wireless keyboard dongle, when you just wanted to type a password on your smart TV? What about RetroPi and a game controller? MyTeleTouch isn’t going to transform your daily experience, but it’ll be there when you don’t want to carry a full-size keyboard down three flights of stairs to press {ENTER} on a machine that spontaneously forgot it has a touch screen. If you don’t have opportunities to play the hero very often, you can choose to play the villain. Hide this in a coworker’s USB port, and while they think you’re sending a text message, you could be fiddling with their cursor.

We enjoy a good prank that everyone can laugh off, and we love little keyboards and this one raises the (space) bar.

Continue reading “Peripheral Doesn’t Need Deskspace”

This Thermal Printer Has Serious Game

[Dhole], like the fox, isn’t the first to connect his computer to a Game Boy printer but he has done a remarkable job of documenting the process so well that anyone can follow. The operation is described well enough that it isn’t necessary to scrutinize his code, so don’t be put off if C and Rust are not your first choices. The whole thing is written like a story in three chapters.

The first chapter is about hacking a link cable between two Game Boys. First, he explains the necessity and process of setting the speed of his microcontroller, a NUCLEO-F411RE development board by STMicroelectronics. Once the rate is set, he builds a sniffer by observing the traffic on the cable and listens in on two Game Boys playing Tetris in competition mode. We can’t help but think that some 8-bit cheating would be possible if Tetris thought your opponent instantly had a screen overflowing with tetrominoes. Spying on a couple of Game Boys meant that no undue stress was put on the printer.

Chapter two built on the first chapter by using the protocol to understand how the printer expects to be spoken to. There is plenty of documentation about this already, and it is thoughtfully referenced. It becomes possible to convince a Game Boy that the connected microcontroller is a printer so it will oblige by sending an image. Since there isn’t a reason to wait for printing hardware, the transfer is nearly instantaneous. In the image above, you can see a picture of [Dhole] taken by a Game Boy camera.

The final chapter, now that all the protocols are understood, is also the climax where the computer and microcontroller convince the printer they are a Game Boy that wants to print an image. In the finale, we get another lesson about measuring controller frequency without an oscilloscope. If you are looking for the hack, there it is. There is a handful of success in the form of old receipts with superimposed grayscale images since virgin thermal printer paper by Nintendo costs as much as a used printer.

This story had a happy ending but grab your reading glasses for the smallest Game Boy and here’s someone who wrote their own Game Boy color game.

Turn Your $10 Dollar Mouse Into A Fancy $10 Dollar Mouse With CNC

We feel it’s healthy to cultivate a general desire for more neat tools. That’s just one of the reasons we like [doublecloverleaf]’s retro PC mouse. It certainly meets the requirement, the first computer mouse was wooden, and the mouse he used as the guts for this is so retro it belongs in the dollar bin at the thrift store.

To begin with, [doublecloverleaf] took a picture of the footprint of his aged, but trustworthy laser mouse. Using the photo in SolidWorks he built a model of the circuit board, and with that digitized, a mouse that suited his aesthetics around it. The final model is available on GrabCAD.

Edit: Woops, looks like we accidentally slandered a great Slovenian community CNC project. Check out the comments for more info. Original text in italics. 

Next came the CNC. It looks like he’s using one of those Chinese 3040 mills that are popular right now. The electronics are no good, but if you luck out you can get a decent set of mechanics out of one. He did a two side milling operation on a wood block, using four small holes to align the gcode before each step, and then milled the bottom out of aluminum. Lastly, he milled the buttons out of aluminum as well, and turned a knurled scroll wheel on his lathe.
The end result looks exceedingly high end, and it would be a hard first guess to assume the internals were equivalent to a $10 Amazon house brand mouse.

Continue reading “Turn Your $10 Dollar Mouse Into A Fancy $10 Dollar Mouse With CNC”