Introduction: Giant USB Volume Knob
Ever wished for a giant volume knob? I have! So I thought I'd have a go at making one and share it in my first Instructables project.
I had 2 goals:
- Adjust volume (Up/Down/Mute)
- Switch playback devices
The Solution: A giant volume knob!
To make things easy I went with using an Arduino ATmega32u4 board. Which can be recognised as a USB HID keyboard (using the NicoHood HID Library).
SoundSwitch is a great lightweight software for playback device switching. It provides a simple UI for set up and has the perfect functionality - shortcut macro keys to switch device, which can easily be emulated by the Arduino.
Step 1: What You Will Need
- Arduino IDE
- Teensy Encoder and NicoHood HID libraries - these should be downloaded through the IDE
- SoundSwitch Application
- Arduino Sketch
Materials - Electronics
- Arduino ATmega32u4 board
- Rotary encoder 5 pin
- Momentary switch
- 3 x 2k0 Ohm resistors
- Toggle switch or Jumper
- Micro USB cable
Materials - Case
- Giant volume knob
- Aluminium U-Channel (15mm square)
- Aluminium sheet (2mm thick)
- Screws & Rivets
Step 2: Getting the Electronics Ready
Testing the circuit
As always I would suggest testing the circuit on a breadboard before moving on to soldering. The last thing you'd want to have to do is desolder everything!
Pin layout reference:
- Encoder Pin A -> Pin 2
- Encoder Pin B -> Pin 3
- Switch -> Pin 5
- SoundSwitch Button -> Pin 4
- HID Switch/Jumper -> Pin 6
*If you find your encoder is reversed, just swap pins A&B on the board or the pinout in line 22 of of the sketch :
Encoder knobVol(2, 3); // VOLUME KNOB
Making the circuit
Depending on the encoder and enclosure you are building, it might be a good idea to have a daughter board for the encoder. The encoder in this build is a very common 12-step encoder. It does not have a mounting thread around the shaft. So I built a little daughter board with a pull down resistor for the switch and some standoffs for mounting.
The Arduino board I used is a cheap version of the Arduino Pro Micro 3.3V/8MHz, I managed to get a bunch of them from aliexpress.com for <$10. Instead of a switch, I opted to use a bent wire jumper as this pin won't need to be toggled very often.
Step 3: Setting Up Software
Programming the Arduino
Before uploading the sketch, there are some dependencies you'll have to take care of.
- HID-Project by NicoHood
- Encoder by Paul Stoffregen
These libraries can be installed directly through the Arduino IDE: Sketch > Include Library > Manage Libraries. Once that is set it should compile and upload without a hitch. If you need to re-upload a sketch, setting the main HID switch to off will make it easier for the Arduino to be recognized.
Installing/Setup of SoundSwitch
Setup is very simple, download and install the latest release of SoundSwitch.
Choose your playback devices and other settings by right clicking on the SoundSwitch icon and going into settings. Make sure to check the "Run on Startup" checkbox, then you're ready to go!
Step 4: Make the Case
*This enclosure was made to match the aesthetic of my PC.
I decided to build a very basic enclosure using bits of aluminium I had lying around.
It is made up of 15mm Square U-Channel pieces cut into rabbet joints then sandwiched between two sheets of 2mm aluminium.
A great way to cut sheet materials is to use a paper template, just print out a 1:1 of your design and stick it to your sheet. This provides a nice guide for your lines and drill holes to help keep things accurate. I've attached the template I used, it was made using cadstd.
I do not recommend making the enclosure as short as I did. The tolerances were very tight. Also it could be wise to remove some of the unnecessary overhang from the U-Channel to give yourself more room.
JB Weld epoxy and rivets were used to fasten the bottom plate to the U-Channel. The same epoxy was used to fill in gaps at the joints. The top plate is held down with screws that have been tapped in to the base, this way it can be taken apart as needed.
I was aiming for a durable matte finish.
- 2 coats epoxy primer
- 2 coats enamel
- 1 coat clear coat
When spray painting it is best to do light passes and let paint build up slowly. A light sanding with high grit sandpaper after the first enamel coat could yield a cleaner result.
To stop your enclosure from sliding you will need to add some form of grip to the bottom. I got very lucky and found these black rubber screw covers that I am using as feet. They fit perfectly over the rivets on the underside of my enclosure. Grip tape, thin foam/rubber were some of the other possibilities.
Step 5: Put It All Together!
Mush it all in there!
Having a semi modular design really helps at this point. Makes taking apart and putting together a lot easier. Be sure to insulate anything that could short! Hot glue and tape are your friends here.
Thoughts / Suggestions
- Having a heavy base is great! Especially if you have buttons mounted on the side like I have done.
- Using an Arduino is a bit overkill for this build. Another possible way to go would be to use a Micro USB Digispark, or other micro controller that can run the HID profile. This would help to miniaturize the enclosure.
- The key combination currently set for SoundSwitch is Crtl+Alt+f11 (default). This can be changed in code line 80-84. Adding a button for switching default recording device can be achieved through the same structure used for play back device.
- There is a lot of extra IO. This leaves space for additions like LEDs (fade with PWM?) or other buttons and controls.
- If you are adding buttons I would recommend using a debounce library instead of boolean states like I have.
Hope this instructable was helpful! Please do let me know if you make your own Giant Volume Knob or have any questions/suggestions :)