Close
0%
0%

The Infinity USB Knob

This is a USB knob that will allow me to execute keyboard shortcuts at each step and get visual feedback

Similar projects worth following
I found very few solutions that would allow me to execute repetitive keyboard actions. It is something that could be useful when working with Lightroom or Photoshop in order to quickly reverse a few actions back and forth to visualize the result.

All commercial items I found are task specific and not very customizable so I decided to build my own.

By using the push button on the rotary encoder I should be able to switch between pre-defined shortcut and get a visual feedback using the Neopixel ring.

I also want to make something accessible to anyone and easy to reproduce.

Current Status

Project completed !

The Knob in action :

The code is here: https://github.com/vincentmakes/InfinityUSBKnob

Hardware

This is the hardware we will use for this project:

A Trinket M0, EC11 rotary knob, a neopixel ring, a nicer knob and an aluminium case from audiophonics.

What I want to achieve

Several mode will be available at each push of the rotary knob, allowing to switch between shortcut possibilities :

ModeActionShortcut (MacOs)LED Colors
1Undo/Redo Lightroom or PhotoshopCmd+Z/Shit+Cmd+ZBlue
2VolumeHID Volume +/-Green
3Close/Reopen tab ChromeCmd+W/Cmd+Shift+TPurple
410s Forward/Backward in VLCCmd+Alt+Left/Cmd+Alt+RightOrange

Connections

The connections are quite straightforward. The A,B,C pin of the encoder are going to the pin 1,2 and 3 of the Trinket. 

Pin 4 is connected to the DI of the ring.

The power consumption is not very high when the brightness is set to 24

The code

Here's what I'm using and the challenges I faced:

Controlling the LED: Just using the Neopixel Library for Arduino. There are two types of animations I want to cover:

1. Turning on LEDs clockwise, turning off LEDs counterclockwise until one LED only is on. Stopping at LED of origin. This is for Undo/Redo actions with finite history.

2. Turning on LEDs clockwise, turning off LEDs countreclockwise but also turning on LEDs further counterclockwise if it passes the LED of origin. This is for volume up/down or any "unlimited" action.

Reading the encoder: the trick is to trigger an action on interrupt to detect when the knob is turned. Therefore the main code will not be in the loop() function but rather in the function called on interrupt.

Sending keyboard commands: I will be using the HID-Project Library. This is important to not use the default Keyboard.h library provided by Arduino because the HID library already includes it. The difference is that some actions are not just keyboard shortcut but requires to interact with the HID. The volume up/down is one of them for example and triggering F11/F12 will not work.

Casing

Anything will work here but I stumble upon this aluminium case that I will re-purpose for the project. I will simply drill holes to mount the knob and be able to see the LEDs.  I have attached a template to mark the holes.

Here's some measurement for the drilling/tapping:

After drilling and tapping

Filling the holes with epoxy

The neopixel ring fits into the casing after machining the inside (see project log, for a poor's man lathe using a drill and a file)

and here it is after jamming everything in there and closing it

neopixel dimensions in inches.png

Neopixel Ring 16 LEDs sourced from Adafruit wiki

Portable Network Graphics (PNG) - 52.11 kB - 02/28/2019 at 08:59

Preview
Download

neopixel_scale.pdf

template for marking holes

Adobe Portable Document Format - 1.50 kB - 02/28/2019 at 08:32

Preview
Download

View all 6 components

  • A poor's man lathe

    vincentmakes03/05/2019 at 07:26 0 comments

    Turns out the wall of the casing is a tad too thick in order to fit the neopixel ring I just received. 

    And I don't have access to a lathe, so I shaved off the 1mm excess with a coarse round file after mounting the casing on a drill. I clamped the portable drill on the bench for that and such filed the inside for 30-40mm.

    I then finished the surface with sandpaper. 

  • First test

    vincentmakes02/28/2019 at 07:58 0 comments

    I put together the components without the casing and wrote some code for testing. Here's a short video that shows how it works with the volume

View all 2 project logs

Enjoy this project?

Share

Discussions

Harlley Sathler wrote 05/22/2019 at 22:52 point

Tried it with a Pro Micro (mega 32u4) and all I get is ring flashing among the five defined colors. Anyone else tried with a 32u4? Any help? Thank you all! 

  Are you sure? yes | no

vincentmakes wrote 05/23/2019 at 11:33 point

Check the specs of your neopixel ring. I used NEO_GRB+NEO_KHZ800 in the configuration but it can be you have another model with white LEDs as well.

  Are you sure? yes | no

Harlley Sathler wrote 05/23/2019 at 12:08 point

Hi, Vincent! Thanks for your kindly repply. I sure will check my ring, but I think it doesn't have white LEDs. In fact it's a chinese clone as I can't buy the original NeoPixel in my country. I will check and try use different configurations. One more question: the knob should work even if the LED ring doesn't? I asked this because rotating and pressing the encoder did nothing and one thing I noted in your photos is you used a dfrobot encoder module that, based on photos on their site, have some resistors and a capacitor mounted alongside the EC11 encoder. I tried it with just the enconder (without the PCB and the other components).

I'm really sorry to bother you with this. I just loved your project and am trying to replicate it with the components I can purchase here, so thank you very very much for your support.

  Are you sure? yes | no

vincentmakes wrote 05/25/2019 at 16:11 point

Yes the knob should work by itself. I would recommend to comment all lines related to the neopixel in the loop to see how it goes. Also note that when I first tried with an 8 led neopixel, it was numbered clockwise while the 16 was numbered counterclockwise (or vice versa). So you need  to figure out in which direction the leds the leds are supposed to go because it impacts  the animation further down the code

  Are you sure? yes | no

fabian wrote 03/25/2019 at 16:51 point

Can You show video how easy is playing in tempest game? Better than keyboard or mouse?

https://en.wikipedia.org/wiki/Tempest_(video_game)

  Are you sure? yes | no

Christian W. wrote 03/20/2019 at 03:38 point

Great job!. I like your idea of using epoxy as a light diffuser in the aluminum case. 

  Are you sure? yes | no

Sophi Kravitz wrote 02/27/2019 at 14:00 point

Hi Vincent! This looks like a useful tool, and could be a cool-looking add-on to the already existing keyboard. I'm curious to see how this will work.  

  Are you sure? yes | no

vincentmakes wrote 02/28/2019 at 08:31 point

Thanks Sophi ! 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates