I used an Arduino to connect a rotary encoder and a digital volume control IC that emulates an analog audio variable resistor. Audio goes in 3.5mm and comes out 3.5mm attenuated. By itself it's basically a volume control knob with some LEDs for feedback. However, the unit also accepts serial input. So once the device is connected to a node.js server with socket.io and serialport modules you have hardware volume that can be simultaneously controlled by a physical knob and any device with a browser.
Components
1×
Rotary Encoder
Spark Fun COM-09117
1×
Mayhew Labs LED-Ring board
Rotary encoder breakout board with a shift register driving an LED ring
Instead of using a Macbook Air as the node.js server and the source of the audio I have set up a Raspberry Pi to server both of these functions. It's a model B running Raspbian and node.js. I also installed pianobar so that eventually I can shove everything into an enclosure along with some speakers and control it all through a web ui.
I got everything into a standard black RadioShack enclosure. I added a green plastic cover from an old calculator to be able to see the LEDs without being able to see the other parts of the circuit board.
I've finally gotten all of the components off of the breadboard. I am now ready to stuff the whole circuit into an enclosure.
The cable in the upper right is USB from the Arduino to a Macbook Air. The Macbook is providing power to the entire circuit and also running a node.js server. The cable in the upper left is audio output to a pair of basic computer speakers. The cable in the bottom left is going to the audio source (also happens to be the Macbook, but it can be anything). In my hand is the rotary encoder. Empty breadboard is there because it's stuck to my 'workbench.' Schematic and code to follow soon, I promise...
The first video I have posted is my project's proof of concept. I've a long way to go before I consider this project finished, but it feels like a good point to start logging my progress.
I got the volume control chip and the voltage inverter as samples so I didn't have much choice in package types. The CS3310 came in an SOIC-16 Wide so I ordered a breakout board from Adafruit ;) However, I got impatient and soldered magnet wire directly to the legs as a crude breakout. This is probably the limiting factor right now in terms of audio quality for the device. It can only be turned so loud before there's a lot of noise.
In the end I had to wait for the real breakout boards anyway because the voltage inverter that I had (required for the -5 V DC input of the CS3310) came in a TSSOP 5-pin package. The footprint of the inverter didn't exactly match the breakout so I had to make a couple of small jumpers. Rough soldering job on this one too, but it works...
I'll get the schematic up soon and that should explain a lot. As soon as I clean up and properly comment my code I'll get that to github and link to it.