Custom Firmware Teaches USB Relay Board New Tricks

If you’re looking for a quick and easy way to control a few devices from your computer, a cheap USB relay board might be the ideal solution. These are fairly simple gadgets, consisting of little more than a microcontroller and a handful of relays. But that doesn’t mean there isn’t room for improvement, and as [Michał Słomkowski] recently demonstrated, flashing these boards with a custom firmware allows the user to modify their default functionality.

In his case, [Michał] wanted to build a power strip that would cut the power to any devices plugged into it once his computer went to sleep. Unfortunately, he couldn’t just check to see if there was 5 V on the line as his motherboard kept the USB ports powered up all the time. But with some modifications to the relay board’s firmware, he reasoned he should be able to detect if there was any USB activity by watching for the start-of-frame packet that goes out every millisecond when the bus is active.

Wiring up the ATtiny45 for flashing.

Now [Michał] isn’t claiming to be the first person to come up with a custom firmware for one of these boards, in fact, he credits an existing open source firmware project as an inspiration for his work. But he did create an entirely new GPLv3 firmware for these ATtiny45 powered devices, which includes among other improvements the latest version of V-USB. As it so happens, V-USB includes start-of-frame packet detection out of the box, which made it much easier to implement his activity detection code.

With the new firmware flashed to the relay board’s chip, [Michał] put it in an enclosure and wired up the outlets. But there was still one missing piece of the puzzle. It seems that Linux won’t actually send out the start-of-frame packets unless its actively communicating with a USB device, as part of the so-called “selective suspend” power saving feature. Luckily there is support for disabling this feature for specific devices based on their Vendor/Product ID pair, so after a little udev fiddling, everything was working as expected.

We love custom firmware projects here at Hackaday. Not only do they keep proprietary software out of our devices, but they often unlock new and expanded capabilities which otherwise would be hidden behind artificial paywalls.

Gesture-Detecting Macro Keyboard Knows What You Want

[jakkra] bought a couple of capacitive touchpads from a Kickstarter a few years ago and recently got around to using them in a project. And what a project it is: this super macro pad combines two touchpads with a 6-pack of regular switches for a deluxe gesture-sensing input device.

Inside is an ESP32 running TensorFlow Lite to read in the gestures from the two touchpads. The pad at the top is a volume slider, and the square touchpad is the main input and is used in conjunction with the buttons to run AutoHotKey scripts within certain programs. [jakkra] can easily run git commands and more with a handful of simple gestures. The gestures all seem like natural choices to us: > for next media track, to push the current branch and to fetch and pull the current branch, s for git status, l for git log, and the one that sounds really useful to us — draw a C to get a notification that lists all the COM ports. One of the switches is dedicated to Bluetooth pairing and navigating menus on the OLED screen.

We love the combination of inputs here and think this looks great, especially with the double touchpad design. Be sure to check out the gesture demo gif after the break.

Gesture input seems well-suited to those who compute on the go, and a gesture glove feels like the perfect fit.

Continue reading “Gesture-Detecting Macro Keyboard Knows What You Want”

Waterslide Decals For Wingding Keycaps

We know this feeling all too well [YOHON!] spent $340 building, lubing, and filming a custom keyboard and it still wasn’t perfect until they got the keycaps sorted. They bought blank ‘caps because they’re awesome, but also because they wanted to make their own custom ‘caps for all those painstakingly lubed and filmed Gateron yellows. At first [YOHON!] thought about doing it DIY dye-sublimation style with a hair straightener and polyimide tape, but that is too permanent of a method. Instead, [YOHON!] wanted room to experiment, make changes, and make mistakes.

Eventually, [YOHON!] learned about waterslide decals and settled on doing them that way. Every step sounds arduous, but we think it was way worth it because these look great. Since [YOHON!] wanted the keyboard to be weird, they designed a cute little symbol for each key which gives it a cryptic-but-accessible Wingdings feel.

We think these pictograms are all totally adorable, and we particularly like the owl for O, the volcano for V, and of course, the skeleton for X is a solid choice. Oh, and there’s a tiny fidget spinner knob to round out the cuteness. Designing and applying the keycaps took longer than the entire keyboard build, but you can check out the sped-up version after the break.

Want to just throw money at the keycaps problem? You may not want an entire keyboard full of cheeseburger and hot dog keycaps, but one or two fun keycaps are pretty cool to have. If you want to make your custom keycaps more permanent and don’t like the dye sublimation trick, try 3D printing them.

Continue reading “Waterslide Decals For Wingding Keycaps”

Tiny Mechanical Keyboard, Powered By Pi Pico

For some applications, smaller is better and that is precisely the thinking behind a diminutive keyboard like the PiPi Gherkin, which is designed to use the Raspberry Pi Pico as its controller. This keyboard may have only 30 keys in total, but they are full-sized for comfort and don’t let the scant layout mislead you. It has more functionality than it would seem to at first glance; the entire bottom row acts as dual function tap/hold keys, allowing the keyboard to shift layers on the fly.

This keyboard definitely has a a thoughtful layout, and we’re not just talking about the tap/shift functionality. We especially like the way the Pi Pico is tucked neatly underneath the main PCB, taking up very little room while exposing its USB connector between two standoffs for easy access without requiring an adapter, or wiring a separate plug.

If the Gherkin sounds familiar, we’ve seen it before as part of this lunchbox cyberdeck build, where the small size allowed it to take up impressively little room. The shifting might take a little getting used to, but it’s a clean design that uses full sized keys, so when it comes to small keyboards one could certainly do worse.

Custom Num Pad Does Double Duty As Macro Pad

Why buy a num pad or a macropad when you can build something new and beautiful, open source that bad boy, and be a hero to the community? We think that should be all the justification you ever need to build instead of buy, even if you think your thing is Just Another Keypad [JAnK] as [Clewsy] claims.

At first glance, JAnK appears to be a standard number pad with four macro keys across the top. But when you roll your own ‘board, all the keys are programmable. [Clewsy] took advantage of this by adding a second layer that’s accessible with (what else?) the Num Lock key. This switches JAnK over to 21-key macro pad mode.

[Clewsy] rolled their own PCB for this and used the venerable ATMega32u4 because of its HID and USB host capabilities. Every key is backlit, and these LEDs are driven by an MP3202 LED driver and PWM from the AVR. [Clewsy] was able to build a prototype by sawing the num pad off of a stainless steel key switch plate from another build, but eventually ordered JAnK its own custom, laser-cut, stainless steel plate. The lovely enclosure is made of spotted gum wood and an acrylic base.

Putting it all together proved to be a bit problematic. [Clewsy] soldered up the minimum viable components for testing and discovered that the ATMega’s VCC and GND pins were both shorted. This killed the AVR programmer, but not the chip itself, and [Clewsy] happened to have a spare. To add insult to injury, the Num Lock light didn’t work, but [Clewsy] was able to simply reverse the LED instead of ordering a new pile of boards. Check out the detailed write-up with code and tons of pictures over on [Clewsy]’s personal site.

One of the awesome things about this build is that [Clewsy] was able to re-use the code from macr0, which began life as a proof of concept for scanning key matrices, and retired to become a music and media controller.

Huge Hand-Wired Ortho Is A Beautiful Battleship Keyboard

There are all sorts of reasons to build your own keyboard, and we would argue that the more custom the layout, the easier it is to justify the time and expense. At least, that’s what we’re going with for this post about [GoldenSights]’ big, beautiful custom ortholinear called Nearer, as in nearer to perfect. Just look at this battleship!

[GoldenSights] has long wanted a mechanical keeb, but has never been into any of the commercial offerings. That goes double since none of them seem to have a vertical Home/End cluster, which [GoldenSights] has become quite attached to thanks to a space-saving Logitech rectangle keeb. But if you’re going to make your own keyboard, you should go all out, right? Right. So [GoldenSights] started by adding another 12 F keys and making it ortholinear. Then things got personal with an extra Backspace where Num Lock usually lives, and dedicated keys for switching between English, Korean, and Chinese.

[GoldenSights] wanted USB-C and so they used an Elite-C microcontroller, but there’s one big problem — it only has 24 pins, and according to the matrix math, the board needs 27 total. Rather than using an I/O expansion chip or a second microcontroller, they wired it up as duplex matrix. This is an alternative way of wiring up a matrix so that it’s closer to being square by doubling up the rows and halving the number of columns.

We don’t think [GoldenSights] gives themselves enough credit here. They say that they lean toward calling it assembly rather than a build, but we disagree with that assessment. [GoldenSights] broke in this giant keeb with giant write-up of the build, so go see for yourself. There’s a ton of build pictures and a fair amount of hot glue, so be warned.

Let’s talk about those keycaps for a second. The space bar was supposed to be black PBT like the others, but the keycap manufacturer didn’t have a 6u space bar in black and sent a gray one instead. Honestly, we like the way it looks. And we love that [GoldenSights] painstakingly laid out the keys on foam board before committing to a laser-cut metal switch plate.

Want a space-saving ortholinear that doesn’t feel too cramped? Check out this wafer-thin keyboard that’s designed to squat over your inferior laptop keys.

Via KBD and r/mk

An Exercise In Firmware Dumping With The GreatFET

Looking to hone his hardware hacking skills, [James Chambers] recently set out to reverse engineer a common cheap wireless keyboard: the Logitech K360. The chipset it uses has already been fairly well explored (and exploited) by security researchers, but the goal here was more about gaining some practical hands-on experience than it was breaking any new ground.

The first post in what we’re sure will be a fascinating series deals with dumping the board’s firmware using the GreatFET. We actually haven’t seen too many projects that showcase the capabilities of this highly capable open hardware multi-tool, so the post serves as a nice demonstration of how one goes about writing the necessary Python scripts to put it to work in a practical scenario.

Some promising bytes.

Of course, even with the best of tools, there’s always a few stumbling blocks. After identifying what was clearly some kind of programming header on the K360’s diminutive PCB, it took a few failed attempts at reading the firmware before [James] realized he needed to tap into more pins on the keyboard’s nRF24LE1 microcontroller. Once everything was physically wired up, he wrote some code for the GreatFET that would perform the proper incantations on the chip’s PROG and RESET pins to enable its programming interface.

[James] goes on to explain how you can pull some extended chip information out of the hardware and verify the contents of the firmware dump with Gihdra, but any more advanced analysis will have to wait until the next post in the series. In the meantime, if you like reading about hardware hacking from this “over the shoulder” viewpoint, you should check out some of the fantastic work that [wrongbaud] has sent in over the last year or so.