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”

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”

Ballpoint Switch Is Oh-So Satisfying

Alright, here’s your quick and dirty hack for the day. The astute among you may recall [Peter Waldraff]’s bookshelf train build of a few days ago, and the fact that he used a switch made from a dead ballpoint pen to light up the scene. Fortunately, [Peter] wrote in to give us the details of this low-voltage sub-build, which you can see in the video after the break.

Essentially, [Peter] starts by making a shortened version of the pen. He modifies nearly every bit of it, including cutting down the ink cartridge, so if you try this, make sure the thing is all dried up first. Then, as he is screwing the point holder back on the barrel, he wraps elastic cord around the inside barrel in lieu of having sewing thread lying around. This cord along with some hot glue will hold a pair of paper clips to the sides of the point holder. When the pen is clicked into the writing position, it makes a connection between the paper clips and closes the circuit on whatever is wired into it.

What types of little hacks like this have gotten you through the build? Let us know in the comments, or better yet, write it up and drop us a tip. By the way, here is that bookshelf train build in case you missed it.

Continue reading “Ballpoint Switch Is Oh-So Satisfying”

Displays We Love Hacking: Parallel RGB

You might have seen old display panels, from 3″ to 10″, with 40-pin FFC connectors where every pin seems to be used for some data signal. We call these displays parallel RGB, or TTL RGB, or DPI, and you can find them in higher-power MCU, Raspberry Pi, and other Linux SBC projects. You deserve to know what to do with those – let’s take a look.

The idea is simple – this interface requires you to constantly send a stream of pixels to the display, and you need to send those pixels through a parallel bus. You can send up to 8 bits per color channel per pixel, which makes for 24 bits, and the 24-bit mode is indeed the standard, but in practice, many parallel RGB implementations don’t bother with more than 5-6 bits of color – two common kinds of parallel RGB links are RGB565 and RGB666. The parallel RGB interface is a very straightforward approach to sending pixels to your display, and in many cases, you can also convert parallel RGB to LVDS or VGA interfaces relatively easily!

If you’re new to it, the easiest way you can drive a parallel RGB display is from a Raspberry Pi, where the parallel RGB interface is known as DPI. This is how 800 x 480 display Pi HATs like the Pimoroni HyperPixel work – they use up almost all of the GPIOs on your Pi, but you get a reasonably high-resolution display with a low power footprint, and you don’t need any intermediate ICs either. FPGAs and some higher-grade MCUs also often have parallel RGB output capability, and surely, someone could even use the RP2040 PIO as well!

Throughout the last decade, parallel RGB has been used less and less, but you will still encounter it – maybe you’re working with an old game console like the PSP and would like to put new guts into it, maybe you’re playing with some tasty display that uses parallel RGB, or maybe you’d like to convert parallel RGB into something else while treating it with respect! Let’s go through what makes parallel RGB tick, what tools you have got to work with it, and a few tips and tricks. Continue reading “Displays We Love Hacking: Parallel RGB”

Turning A 1:150 Scale Model Car Into A Real Driving Car With Lights

Closing up the remotely controlled 1:150 scale model car. (credit: diorama111)

For many people having a miniature version of something like a car is already a miracle in itself, but there’s always the possibility to take matters a bit further, as YouTube channels like [diorama111] demonstrate. In this particular case, they took a 1:150 scale model of a Nissan Micra and installed a microcontroller, battery, remote steering and front, rear and indicator lights. Considering the 24.5 x 11.4 x 10.5 mm (LxWxH) size of the scale model, this is no small feat.

The original plastic bottom and wheels are removed, and replaced with a metal frame, as well as steerable front wheels that have a neodymium magnet attached to follow a metal guidance track that can be underneath the road surface. For the brains an ATtiny1616 MCU in QFN format is used to receive commands from the PIC79603 infrared receiver module and drive the motor attached to the rear axle via a DRV8210 motor controller IC. The remaining MCU pins are mostly used for turning the LEDs on the lights and signals on or off.

In the video the miniscule RC car is driven around a course with traffic lights, which gives a good impression of how this could be used in a large scale model of a city, with a hidden rail system to determine car routes. As for keeping the 30 mAh Li-Po battery charged, there’s a charge port on the bottom, but at these low current rates you could have hidden conductive charging points throughout the route as well, assuming you can fit a small enough charging coil in this little space.

(Thanks to [Keith Olson] for the tip)

Continue reading “Turning A 1:150 Scale Model Car Into A Real Driving Car With Lights”

Printed Centrifugal Dust Separator Stays On Budget

Anyone who’s ever spent time in a woodworking shop knows how much dust is produced when cutting, sanding, and so on. [Tim] of Pilson Guitars was looking to outfit his shop with centrifugal dust separators to combat the problem, which are supposed to remove over 99% of the sawdust particles right out of the air. Unfortunately, they can cost thousands of dollars. So he decided to try making his own.

Centrifugal dust separator design, by Tim at Pilson Guitars.
Centrifugal dust separator design, by Tim at Pilson Guitars.

Using a clear PVC tube and 100 hours of printing on his Prusa i3 MK3, his CAD file had come to life, ready to use the power of centrifugal air to leave just enough fine dust in the output port to have a HEPA filter handle the remainder. Unfortunately, initial testing showed that a single dust separator filtered out far less than 90%, and even adding a second unit bumped that up to only 94.2%. Still impressive, but this would clog up a HEPA filter in no time. Thus [Tim] had a second try at it, after a range of helpful comments to the first video.

Changes included a different design for the impeller blades to improve the vortex, as well as attempting to run the system in series. Sadly more issues cropped up, with apparently the air also seeking a way via the collection bins that has [Tim] rethinking more aspects of the design. He has made the design files (STEP and more) available on GitHub for perusal by the community and hopefully some constructive input on how to DIY such dust separation system.

Over the years, we’ve seen many different approaches to the problem of dust collection. We’ve covered other 3D printed solutions if your printer is looking for something to do, but if you’d prefer something a little more low-tech, this traffic cone dust separator is particularly clever.

Continue reading “Printed Centrifugal Dust Separator Stays On Budget”

World’s First Precision Lathe: Indispensable When Constructing The Antikythera Mechanism

The precision lathe with the hooks, the bowstring, and vise visible as material is being processed. (Credit: Clickspring)

We commonly tend to associate lathes with the Industrial Revolution, when metalworking shifted largely from blacksmiths to machinists, but the use of lathes is much older than that. As [Chris] over at the Clickspring YouTube channel demonstrates in a recent video, small precision lathes were exceedingly common in the Ancient World. Not only is there ample historical evidence of them being used as far back as 1300 BCE in Ancient Egypt, but they’re also the most optimal way to get perfectly round pins and other, more intricate shapes that would be an absolute nightmare to create with just some metal files and chisels.

In the video, [Chris] uses two metal hooks, bent in a ninety-degree angle and clamped down in a vise, tapering towards each other into points. A bow string around a round piece of wood is used to bootstrap a more permanent retention element and bushing for the bow string as it is drawn over the wood to rotate it. Subsequent material that has to be worked on in the lathe is then clamped between the two points. This way, using basic materials that have been around for thousands of years and some muscle power, it’s possible to create a small lathe that can be used to create perfectly symmetrical shapes, such as those used in the construction of the Antikythera Mechanism, which [Chris] has been rebuilding for the past years, using only period-correct tools. He’s learned a lot about the mechanism in the process.

Continue reading “World’s First Precision Lathe: Indispensable When Constructing The Antikythera Mechanism”