Low-Cost Computer Gesture Control With An I2C Sensor

Controlling your computer with a wave of the hand seems like something from science fiction, and for good reason. From Minority Report to Iron Man, we’ve seen plenty of famous actors controlling their high-tech computer systems by wildly gesticulating in the air. Meanwhile, we’re all stuck using keyboards and mice like a bunch of chumps.

But it doesn’t have to be that way. As [Norbert Zare] demonstrates in his latest project, you can actually achieve some fairly impressive gesture control on your computer using a $10 USD PAJ7620U2 sensor. Well not just the sensor, of course. You need some way to convert the output from the I2C-enabled sensor into something your computer will understand, which is where the microcontroller comes in.

Looking through the provided source code, you can see just how easy it is to talk to the PAJ7620U2. With nothing more exotic than a switch case statement, [Norbert] is able to pick up on the gesture flags coming from the sensor. From there, it’s just a matter of using the Arduino Keyboard library to fire off the appropriate keycodes. If you’re looking to recreate this we’d go with a microcontroller that supports native USB, but technically this could be done on pretty much any Arduino. In fact, in this case he’s actually using the ATtiny85-based Digispark.

This actually isn’t the first time we’ve seen somebody use a similar sensor to pull off low-cost gesture control, but so far, none of these projects have really taken off. It seems like it works well enough in the video after the break, but looks can be deceiving. Have any Hackaday readers actually tried to use one of these modules for their day-to-day futuristic computing?

Continue reading “Low-Cost Computer Gesture Control With An I2C Sensor”

Arduino Brings USB Mouse To Homebrew Computer

When building your own homebrew computer, everything is a challenge. Ultimately, that’s kind of the point. If you didn’t want to really get your hands dirty with the nuts and bolts of the thing, you wouldn’t have built it in the first place. For example, take the lengths to which [rehsd] was willing to go in order to support standard USB mice on their 6502 machine.

Code for mapping mouse movement to digital output.

The idea early on was to leverage existing Arduino libraries to connect with a standard USB mouse, specifically, the hardware would take the form of an Arduino Mega 2560 with a USB Host Shield. There was plenty of code and examples that showed how you could read the mouse position and clicks from the Arduino, but [rehsd] still had to figure out a way to get that information into the 6502.

In the end, [rehsd] connected one of the digital pins from the Arduino to an interrupt pin on the computer’s W65C22 versatile interface adapter (VIA). Then eleven more digital pins were connected to the computer, each one representing a state for the mouse and buttons, such as MOUSE_CLICK_RIGHT and MOUSE_LEFT_DOWN.

Admittedly, [rehsd] says the mouse action is far from perfect. But as you can see in the video after the break, it’s at least functional. While the code could likely be tightened up, there’s obviously some improvements to be made in terms of the electrical interface. The use of shift registers could reduce the number of wires between the Arduino and VIA, which would be a start. It’s also possible a chip like the CH375 could be used, taking the microcontroller out of the equation entirely.

From classic breadboard builds to some impressively practical portable machines, we’ve seen our fair share of 6502 computers over the years. Despite the incredible variation to be found in these homebrew systems, one thing is always the same: they’re built by some of the most passionate folks out there.

Continue reading “Arduino Brings USB Mouse To Homebrew Computer”

Raspberry Pi Pico Makes For Expeditious Input Device

With its copious number of GPIO pins and native USB, the Raspberry Pi Pico is arguably the ideal microcontroller for developing your own platform agnostic USB Human Input Devices. But you don’t have to take our word for it. Check out how quickly the $4 USD board allowed [Alberto Nunez] to put together a pair of foot pedals for his computer.

Wiring doesn’t get much easier than this.

A peek inside the enclosure reveals…well, not a whole lot. All that’s hiding inside that heavy-duty plastic box is the Pi Pico and some screw down terminals that let [Alberto] easily wire up the female bulkhead connectors for the pedals themselves. Incidentally, while you could certainly make your own pedals, the ones used for this project appear to be the sort of commercially available units we’ve seen used in similar projects.

With the hardware sorted, [Alberto] just needed to write the software. While he could have taken the easy way out and hard coded everything, we appreciate that his CircuitPython script loads its configuration from a text file. This allows you to easily configure which GPIO pins are hooked up to buttons, and what key codes to associate them with. He didn’t really need to go through this much effort for his own purposes, but it makes the project far easier to adapt for others, so our hats off to him.

If you’re looking for a bit more inspiration, our very own [Kristina Panos] put together a Python-powered macro foot stool that you can put under your desk for rapid fire keyboard shortcuts. Plus you can stand on it to reach the top shelf, if need be.

Spooky USB Baby Types Out Messages From Beyond

You might think it’s a bit early for us to be running Halloween hacks, but don’t worry. While this microcontroller-equipped doll that mimics a USB keyboard to type out messages in the creepiest way possible might seem like a gag gift you’d get after attending somebody’s bone-chilling holiday bash, creator [Jonathan] actually put it together for a friend’s wedding. So not only is it an interesting piece of hacked together hardware, but it’s also a great reminder about the importance of having a wedding registry.

Even if this seems like a rather unusual wedding gift from an outsider’s perspective (for the record, pranks involving this “haunted doll” have been a running gag between them since their school days), we can’t help but be impressed with the way [Jonathan] implemented it. An ATtiny85-powered Digispark is hidden inside the doll, along with a simple USB 2.0 hub that supposedly eases some teething issues the diminutive development board has with newer USB 3.0 ports. Through the use of V-USB, this lets the baby type out messages once plugged into the recipient’s computer.

Soldering the Digispark to a cheap USB hub keeps newer computers happy.

Now he could have just stopped there, but [Jonathan] wanted this to be an interactive experience. Specifically, he wanted the baby to present the newlyweds with a personally test of sorts, and that meant taking user input. He came up with the clever user interface demonstrated in the video below, which responds to changes in the system’s “Caps Lock” state.

This platform-agnostic solution lets the user navigate the doll’s menu system by tapping a single key, although the Chromebook users out there will have to break out the Alt key to play along. It’s a neat trick for getting two-way communication going between a MCU and a computer without any client-side software, and worth filing away mentally for future non-haunted projects. It’s also worth checking out the effort [Jonathan] put into optimizing everything to fit into the chip’s paltry 6012 bytes of flash.

Incidentally, this is a good a time as any to remind readers that our Halloween Hackfest contest is live right now and taking entries until October 11th. If you’ve got any cursed bar mitzvah gifts you’ve been putting the finishing touches on, we’d love to see them.

Continue reading “Spooky USB Baby Types Out Messages From Beyond”

Hands On: DEF CON 29 Badge Embraces The New Normal

To say that 2020 was a transformative year would be something of an understatement. The COVID-19 pandemic completely changed the way we worked, learned, and lived. Despite all those jokes about how much time people spend on their devices rather than interacting face-to-face with other humans, it turns out that when you can’t get more than a few people together in the same room, it throws our entire society into disarray.

Our community had to rethink how we congregated, and major events like HOPE, DEF CON, and even our own Hackaday Supercon, had to be quickly converted into virtual events that tried with varying degrees of success to capture the experience of hundreds or thousands of hackers meeting up in real life. While few would argue that a virtual hacker convention can ever truly replace a physical one, we learned there are undeniable benefits to embracing the advantages offered by cyberspace. If nothing else, the virtual hacker meetups of 2020 saw a far larger and more diverse array of attendees and presenters than ever before.

As we begin seeing the first rays of light at the end of the long, dark, tunnel we’ve been stuck in, it’s clear that some of the changes that COVID-19 forced on our community are here to stay. As eager as we all are to get back to the epic hackfests of old, nobody wants to close the door on all those who would be unable to attend physically now that they’ve gotten to peek behind the curtain.

With this in mind, this year’s DEF CON is being presented in both physical and virtual forms simultaneously. If you made to Las Vegas, great. If not, you can follow along through chat rooms and video streams from the comfort of your own home. Following the theme, the DC29 badge is not only a practical tool for virtual attendees, but an electronic puzzle for those who are able to bring a few of them together physically. Let’s take a closer look at this socially distanced badge and the tech that went into it.

Continue reading “Hands On: DEF CON 29 Badge Embraces The New Normal”

Breaking Down The USB Keyboard Interface With Old-Fashioned Pen And Paper

What is better for gaming, old PS/2 style keyboards, or modern USB devices? [Ben Eater] sets out to answer this question, but along the way he ends up breaking down the entire USB keyboard interface.

It turns out that PS/2 and USB are very, very different. A PS/2 keyboard sends your keystroke every time you press a key, as long as it has power. A USB keyboard is more polite, it won’t send your keystrokes to the PC until it asks for them.

To help us make sense of USB’s more complicated transactions, [Ben] prints out the oscilloscope trace of a USB exchange between a PC and keyboard and deciphers it using just a pen and the USB specification. We were surprised to see that USB D+ and D- lines are not just a differential pair but also have more complicated signaling behavior. To investigate how USB handles multi-key rollover, [Ben] even borrowed a fancy oscilloscope that automatically decodes the USB data packets.

It turns out that newer isn’t always better—the cheap low-speed USB keyboard [Ben] tested is much slower than his trusty PS/2 model, and even a much nicer keyboard that uses the faster full-speed USB protocol is still only just about as fast as PS/2.

If you’d like to delve deeper into keyboard protocols, check out [Ben]’s guide to the PS/2 keyboard interface, complete with a breadboarded hardware decoder. If these keyboards have too many keys for your taste, you might consider this USB Morse code keyboard. Thanks to Peter Martin for the Tip!

A Physical Front Panel For Oscilloscope Software

For hackers on a tight budget or with limited bench space, a USB oscilloscope can be a compelling alternative to a dedicated piece of hardware. For plenty of hobbyists, it’s a perfectly valid option. But while the larger discussion about the pros and cons of these devices is better left for another day, there’s one thing you’ll definitely miss when the interface for your scope is a piece of software: the feel of physical buttons and knobs.

But what if it doesn’t have to be that way? The ScopeKeypad by [Paul Withers] looks to recreate the feel of a nice bench oscilloscope when using a virtual interface. Is such a device actually necessary? No, of course not. Although one could argue that there’s a certain advantage to the feedback you get when spinning through the detents on a rotary encoder versus dragging a slider on the screen. Think of it like a button box for a flight simulator: sure you can fly the plane with just the keyboard and mouse, but you’re going to have a better time with a more elaborate interface.

The comparison with a flight simulator panel actually goes a bit deeper, since that’s essentially what the ScopeKeypad is. With an STM32 “Blue Pill” microcontroller doing its best impression of a USB Human Interface Device, the panel bangs out the prescribed virtual key presses when the appropriate encoder is spun or button pressed. The project is designed with PicoScope in mind, and even includes a handy key map file you can load right into the program, but it can certainly be used with other software packages. Should you feel so inclined, it could even double as a controller for your virtual spaceship in Kerbal Space Program.

Affordable USB oscilloscopes have come a long way over the years, and these days, using one is hardly the mark of shame it once was. But the look and feel of the classic bench scope is about as timeless as it gets, so we can certainly see the appeal of a project that tries to combine the best of both worlds.

Continue reading “A Physical Front Panel For Oscilloscope Software”