Hacking digital volume control into an old stereo
My home AV setup is always in a sort of flux- usually cobbled together out of various found and repurposed components. I’m usually able to get what I want out of it, but recently I ran into a bit of a challenge. All of the audio for the setup is fed into an older home stereo system via a D/A converter attached to the TOSLINK digital output of my TV. This allows the audio of all my different devices to be switched by the TV whenever I change the input signal. I found the solution quite elegant, but the issue is that my TV is unable to control the output volume to the digital output, so I am stuck with whatever volume is set on the analog stereo system. This would be a non-issue if I had a more modern stereo receiver that could be controlled with a remote, or if I was willing to deal with having to get up off the couch every time I want to adjust the audio. Of course the easy solution would be to purchase a new stereo receiver and be done with it. But, if you are familiar with any of my other projects, that is not how I tend to do things.
Having worked with the IRremote libraries for Arduino on a recent project, I figured that I had on hand what I would need to intercept the signal coming from my TV remote, and use it to control the output volume of the stereo using a pair of digital potentiometers. I began by prototyping the circuit on a breadboard, to verify that I would be able to interpret the infrared signals coming from the remote, and control my two digital pots via the SPI bus. Once that was achieved, I moved on to taking apart the stereo, mainly to find out what kind of voltages were available to power my circuit.
It did stand to reason that there would be a 5 volt rail used to power the logic circuitry, but the stereo is rather awkwardly built, and the points where I would be able to piggyback off of the 5v rail were not easily accessible. But luckily there was a 12v rail that was much easier to access, so I chose to simply jump off of that and use a standard LM7805 voltage regulator to knock it down to the 5v I needed. Once this was determined, I took to designing the circuit.
Please forgive my messy handwriting. A quick explanation of the circuit:
U1 is an Arduino nano, which is doing the heavy lifting of the circuit. It receives signal from the infrared receiver module(IRM), and then sends messages over the SPI bus to adjust the potentiometers. It was a simple task to find the codes required for volume up and volume down, I just had to use the included example code to print the IR codes to the serial monitor, and then point the remote at it and press the buttons that I wanted to use.
U2 and U3 are MCP4131 100k digital potentiometers, controlled via SPI. A higher value could have been used to get a larger volume swing, but these seemed to work well enough. I chose to insert my circuit before the manual volume control of the stereo, so that I could still adjust the max volume to find a good operating level. Of course they are not an ideal choice as their resistance curve is linear, whereas a logarithmic curve would be ideal for audio(humans hear logarithmically, not linearly). But they were what I had on hand, and worked well enough. If I choose to revisit this project, the volume values could converted to a logarithmic scale in firmware with some simple computations.
U4 is a 74HC595 shift register. I simply used this to drive a line of 8 LEDs to indicate the volume level. The current through the LEDs is limited by a 4.7K resistor pack. They actually ended up being quite bright in a dark room, so the resistance value could be increased to further limit the current and decrease the brightness. I could also adjust the code to have it only flash the LEDs while the volume is being adjusted, which would be much less distracting.
J1 is a terminal block. This is where I intercept the audio signal from the stereo, and receive power from the unit.
There is also a bypass capacitor positioned as close as possible to each IC, to limit digital noise being added to the circuit. The value chosen was 1uF.
Not pictured is the LM7805 voltage regulator, and accompanying decoupling capacitors.
Pictured above is the circuit. From left to right we have the Arduino Nano, 595 shift register, and two MCP4131 digital pots. The large heat sink is attached to the 7805 voltage regulator, as it has to dissipate a fair bit of power to bring the 12v input down to 5v. A more efficient solution would be to use a switching level converter, but this is not ideal for audio as it introduces switching noise to the circuit, and once again, I had the 7805 on hand. The wires snaking off around the shift register are going to the front panel LEDs.
I also chose to socket each chip in case something went wrong and I had to replace any of them during installation.
The project went together fairly painlessly from here. I did had to make sure the cable I used to intercept the audio signal was well shielded, otherwise the digital noise from switching the volume level was audible. I think that any audiophiles would be scoffing at this solution, as I’m sure there’s more electrical noise being thrown around inside the unit now. But I haven’t noticed an appreciable difference to the noise floor of the system, and I don’t use this setup for any critical listening or professional audio work.
Once the switching noise was ironed out, I was able to deem the project complete. It may have been more work than buying a new stereo, but I’m always willing to do whatever I can to keep perfectly good equipment out of the landfill. And now I get to experience the extra satisfaction of using this stereo knowing that I improved it with my own efforts.
Thanks for reading!