This Super-Simple ATtiny85 Project Is the Ultimate $5 Computer Upgrade
Build a $5 plug-and-play USB volume knob with an ATtiny85 to control your audio with one simple, satisfying twist.
Keyboard shortcuts are both a huge productivity boon and a major source of frustration. Remembering them can save a person from doing a lot of mousing and navigating through menu systems — but you do have to memorize them. What’s worse, these shortcuts often change from one application to the next.
This has led to a surge in popularity of customizable macropads that condense keyboard shortcuts into a single keypress. However, these macropads can take up a lot of desk space, and many of them are also quite expensive. What if all you want to do is quickly adjust the audio volume? For cases such as these, Albert David has come up with the perfect solution. It’s a dirt-cheap, plug-and-play knob that you simply slide into a USB port and start using immediately.
The project is built on top of a Digispark ATtiny85 USB development board. This is paired with a KY-040 rotary encoder and just a handful of wires to turn the device into a dedicated USB media controller. Turning the knob clockwise raises volume, counter-clockwise lowers it, and pressing it mutes the audio. Because the firmware presents itself as a standard USB HID Consumer Control device, operating systems treat it exactly like the volume buttons on a keyboard or headset — no drivers or companion software are required.
The entire build costs roughly five dollars, and assembly is very straightforward. Five connections link the encoder to the board: the CLK and DT signal pins go to GPIO pins PB5 and PB2, the pushbutton switch connects to PB0, and the remaining two wires provide power and ground. Add a knob cap and, optionally, a 3D-printed enclosure, and the hardware is finished.
Under the hood, the firmware sends standardized media control commands: volume up, volume down, and mute. By relying on widely supported HID usage codes, the knob functions on desktops, media PCs, and even Raspberry Pi home theater boxes. With a USB OTG adapter, the device also works with Android phones.
The source code and build instructions are available on GitHub for anyone who would like to build their own USB volume control knob.