1 knob, 6 functions.
This tiny, super cheap media controller works with all devices that s USB Media Controls - computers, tablets, phones etc. Tested so far with Windows 10 & Android 6.
A single knob performs the following:
- Play - press knob
- Pause - press knob again
- Volume up - turn knob right
- Volume down - turn knob left
- Previous track - press AND turn knob left
- Next track - press AND turn knob right
You can also replace the actions of the knob with pretty much any key press, (or combinations of key presses) that you want. See Changing functions further down this page.
There are several one-knob media controllers out there, but I've found no version that allows you to change tracks without dedicated buttons (like my larger Arduino Pro Micro-based Media Controller has). And none so cheap and easy to build.
The only components needed are a Digispark (Micro USB version) Arduino microcontroller and a KY-040 rotary encoder, which can be had for about 1β¬ each on eBay/Ali. A few wires to solder and that's it - hardware is done!
I'm also including the Arduino source I wrote which includes (or links to) pinouts, libraries , instructions and pretty much everything you need in order to program the controller.
I made several different knobs that you can choose from. The encoder has a standard D-shaped 6mm shaft so there are a multitude to choose from if you want to get one from elsewhere.
Designed to snap together, but I included holes and for adding small screws for those of you who are inclined to.. ahem.. screw around.
When assembling, make sure that the Digispark and the KY-040 are fully seated in the base before putting the top on - if the boards don't fit, remove any imperfections on their edges with a small file.
If you want to sand the parts (I did) or paint them (I didn't), do so before mounting the boards. It's possible to close the case without the boards, and later prying them apart without breaking the parts. This makes it easier to sand and not worry about the edges.
After assembling, add either self-adhesive rubber feet or glue a rubber sheet on the bottom to stop it from sliding around. If the media controller will be stationary, you can also fixate it with double-sided tape.
CHANGING FUNCTIONS
Do you want the knob to do something else than control multimedia? No problem!
If you open the Arduino source (.ino), at the end of the file the actions performed are stated like this:
TrinketHidCombo.pressMultimediaKey(MMKEY_SCAN_PREV_TRACK)
Just change the key in the parenthesis to any in the list below. If two lines like this are in the same statement, they will execute right after each other, even making it possible to write advanced macros.
System control keys
+ SYSCTRLKEY_POWER
+ SYSCTRLKEY_SLEEP
+ SYSCTRLKEY_WAKE
Multimedia keys
+ MMKEY_VOL_UP
+ MMKEY_VOL_DOWN
+ MMKEY_SCAN_NEXT_TRACK
+ MMKEY_SCAN_PREV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+ KEYCODE_F7
+ KEYCODE_F8
+ KEYCODE_F9
+ KEYCODE_F10
+ KEYCODE_F11
+ KEYCODE_F12
+ KEYCODE_APP
+ KEYCODE_ENTER
+ KEYCODE_BACKSPACE
+ KEYCODE_ESC
+ KEYCODE_TAB
+ KEYCODE_SPACE
+ KEYCODE_INSERT
+ KEYCODE_HOME
+ KEYCODE_PAGE_UP
+ KEYCODE_DELETE
+ KEYCODE_END
+ KEYCODE_PAGE_DOWN
+ KEYCODE_PRINTSCREEN
+ KEYCODE_ARROW_RIGHT
+ KEYCODE_ARROW_LEFT
+ KEYCODE_ARROW_DOWN
+ KEYCODE_ARROW_UP