Human-Interfacing Devices: Packing For The Descriptor Heist

We started with figuring out HID descriptors a week ago, and I’ve shown you how to send raw HID packets using a MicroPython fork. We do still have the task in front of us – making a touchscreen device. For that, let’s give you the tools to capture an existing descriptor from a touchscreen, then show you how to tweak it and how it turns out in the end.

Packing For The Heist

When it comes to this kind of adventure, we can’t go without tools and weapons – it could be dangerous! Without them, you could even abandon your project halfway! Here’s enough high-precision tools and ammunition to last you through whatever obstacles you might encounter. Except for the web-based tools, these tools are for Linux, but please remember that you can always use a virtual machine or a Raspberry Pi. Nobody would use Windows for a heist anyway, what’s with all the telemetry and such.

The first tool is for reading descriptors – we need one to learn from, it’s just like a keycard you can flash to a security guard and scan at the vault entry. Of course, with RFID, you want to have enough examples, compare bits between a few cards and all. For now, HID descriptors don’t have authenticity checks, but it looks like that might just change in the future. Leave it to Apple and Microsoft to add them, as usual. On Linux, seeing descriptors is simple – as root, go into /sys/bus/usb/devices/, find your device by its lsusb device tree path, then follow the directory with the VID/PID in it. That directory will contain a report_descriptor file – hexdump it. The entire command could look like this:

sudo hexdump -v -e '/1 "%02X "' /sys/bus/usb/devices/3-6.2/3-6.2\:1.1/0003\:0C40\:8000.0022/report_descriptor`

Again, you might need root to even find this path, so use sudo -i if you must. The format string in the hexdump command gives you parser-friendly output. Specifically, for parsing, I use this webpage – it’s wonderful, even adding tabs that delineate different sections of the descriptor, making its output all that more readable! You can also save this webpage locally, it’s a very neat tool. Other than that, you can try other local tools like this one!

Continue reading “Human-Interfacing Devices: Packing For The Descriptor Heist”

Altoids Tin Keyboard Is A Breath Of Fresh Air

Well, here’s a fresh idea! [flurpyflurples] is back from hiatus with the Mintboard, a 40% that fits inside of an Altoids tin. Who could ask for more than a rugged little Bluetooth keyboard with a built-in cover that fits in your pocket?

This build started with meticulously measuring the tin to figure out what kind of switches could be used. At first, this was going to be a 60% keyboard, but after a lot of design decisions and switch comparisons, [flurpyflurples] settled on a certain micro switch spaced at 7.3mm for a 40% layout. Then it was time to design a PCB.

Although [flurpyflurples] tends to use Arduino Pro Micros in their builds, they went with the Nice! Nano this time for the Bluetooth capabilities. This means that they had to program it with ZMK instead of QMK, but found that QMK knowledge transfers rather nicely.

Let’s talk about those lovely legends. The keycaps are 3D printed of course, and the legends were cut out on a Cricut machine. The best part is that sealant — [flurpyflurples] used a few drops of UV nail polish top coat and cured it with light.

We think this looks and sounds fantastic, and would really like to know how to get such clean cutouts. According to [flurpyflurples] and the end of the build/demo video you’ll find below the break, the action is a lot like a Blackberry keyboard.

Continue reading “Altoids Tin Keyboard Is A Breath Of Fresh Air”

3D Mouse With 3D Printed Flexures And PCB Coils

3D mice with six degrees of freedom (6DOF) motion are highly valued by professional CAD users. However, the entry-level versions typically cost upwards of $150 and are produced by a single manufacturer. [Colton Baldridge] has created the OS3M Mouse — an open source alternative using PCB coils and 3D printed flexures.

The primary challenges in creating a 6DOF input device, similar to the 3Dconnexion Space Mouse, lie in developing a mechanical coupling that enables full range motion, and electronics capable of precisely and consistently measuring this motion. After several iterations of printed flexure combinations and trip down the finite element analysis (FEA) rabbit hole, [Colton] had a working single-piece mechanical solution.

To measure the knob’s movement accurately, [Colton] employs inductive sensing. Inductance to Digital Converters (LDCs) assess the inductive alterations across three pairs of PCB coils, each having an opposing metal disk mounted on the knob. This setup allows [Colton] to use a Stewart platform‘s kinematic model calculate the  knob’s relative position. The calculation are done on an STM32 which also acts USB HID send the position data to a computer. For the demo [Colton] created a simple C++ app to translate the position data to Solidworks API calls.

Continue reading “3D Mouse With 3D Printed Flexures And PCB Coils”

Illustrated Kristina with an IBM Model M keyboard floating between her hands.

Keebin’ With Kristina: The One With The Typewriter Orchestra

Have you ever wished you had more control over what goes into a kit keyboard build? Like, a whole lot more control? Well, that’s the idea behind the Akruvia 12×4 Playground by [iketsj].

Image by [iketsj] via YouTube

This is a 48-key ortholinear keyboard, but other than that, it’s a complete blank slate. The kit includes the PCB, diodes, RGB LEDs, and Kailh Choc V1 hot swap sockets, which is really the only choice you don’t have in the matter.

All the rest is up to you, thanks to a generous prototyping area that wraps around three sides of the keys. Bring your own microcontroller and anything else that sounds useful, like displays, rotary encoders, gesture sensors, pointing devices, you name it.
You could even magnetically link a macro pad to one side, as [iketsj] teases in the intro video. [iketsj] has made the kit available through links on their website, and you’ll find a product guide there as well.

Continue reading “Keebin’ With Kristina: The One With The Typewriter Orchestra”

A Basic USB-C Primer

Over the last five years or so there has been a quiet take-over of the ports on laptops, phones, and other devices, as a variety of older ports as well as the familiar USB A and micro USB sockets have been replaced by the now-ubiquitous USB-C port. It’s a connector which can do so many things, so many in fact that it bears a handy explanation. The Electromagnetic Field 2022 hacker camp has been quietly uploading videos of its talks, and a recent one has [Tyler Ward] explaining the intricacies of the interface.

Many of you will be familiar with XKCD number 927 which makes a joke about proliferating connector standards, and it’s evident that USB-C is a rare case of a connector which bucks the trend of simply making another standard, and has instead created something with which it makes sense to replace what went before. We learn about the intricacies of inter-device communications and USB-PD, and the multiple high-speed connection  lanes shoehorned into it. That one small connector can plug into a laptop and provide power, USB peripherals including network, and display, is nothing short of amazing. Take a look at the video below the break, and if you’re interested in diving deeper, have a look at our colleague [Arya Voronova]’s USB-C for hackers series.

Continue reading “A Basic USB-C Primer”

Human-Interfacing Devices: The Descriptor Heist

Today, we’ll build our own input devices. And they will be easy to create and write firmware for, they will work perfectly, and they will be cross-platform. We can do that with help of the Human Interface Device (HID) standard, and by way of introduction, so that you never get confused by what a “descriptor” means, and we’ll build our own HID device — a Human Interface Device device. The way we build them won’t require reading specifications – instead, I’ll teach your how to steal HID descriptors from existing devices, tweak them for our purposes, and use them in our devices to harness the power of HID.

For decades now, it’s been possible to build a HID mouse or keyboard by using a library or two, and it’s been a godsend for hackers all around the world. However, these libraries are typically confined to a certain template and inflexible, and we hackers often go outside of what’s expected. HID allows for much more than a simple keyboard or a mouse. That’s why today we’re building a touchscreen – something not yet covered online or by libraries.

HID lets you build devices that are friendly. They don’t need drivers, they are plug and play, and they do what you expect them to do. At its core, the HID standard is as simple as is ubiquitous. You can tunnel HID over USB, Bluetooth, I2C, and modern-day operating systems support all three of these. Today, let’s go through the basics of HID, and then build a USB touchscreen out of a SPI-connected resistive touchscreen, with help of the usual RP2040+MicroPython combo. I will also give you a toolkit for how to debug a Human Interface Device device as thoroughly as possible – specifically on Linux, showing all the HID debug and introspection capabilities that Linux gives you. But it’ll work on Windows too through the beauty of standardization.

Continue reading “Human-Interfacing Devices: The Descriptor Heist”

A Mouse Becomes A Camera

If your pointing device is a mouse, turn it over. The chances are you’ll see a red LED light if you’re not seriously old-school and your mouse has a ball, this light serves as the illumination for a very simple camera sensor. The mouse electronics do their thing by looking for movement in the resulting image, but it should be possible to pull out the data and repurpose the sensor as a digital camera. [Doctor Volt] has a new video showing just that with the innards of a Logitech peripheral.

The mouse contains a microcontroller and the camera part, which fortunately has an SPI interface. The correct register to query the sensor information was deduced, and as if my magic, an image appeared. An M12 lens provided focus with a handy 3D printed mount, and the board went back into the mouse case as a housing. The pictures have something of the Game Boy camera about them, being low-res and monochrome, but it’s still a neat hack.

If you’d like to give it a go you can find the code in a GitHub repository. You might find it worth finding a gaming mouse though, for the much higher resolution sensor.

Continue reading “A Mouse Becomes A Camera”