Balanced Volume Controller / Line Stage

Excellent thread here!

Learning a lot on the trade offs between various topologies.

I’ll be following this closely.

PS even though the clicking is common in r2r ladders I believe it can be mitigated via software and/or other tricks.

Despite this drawback I’ve used this design in my system for some time and have come to view the clicking as gratifying.
 
Last edited:
Member
Joined 2009
Paid Member
Controlling the volume control chips

I got a request to share the Arduino sketch I used to control the MUSES72320 chip. In response, I attach the sketches to control each of the three digitally controlled boards I developed.

The sketches were created for test purposes, so they are functional but very much barebone. Let me know if you spot an error in any of the sketches.

As a little preview, I am finalizing a "digital knob" - see the picture. It is an Arduino in a very small form factor with an encoder attached and UART, SPI, I2C and some GPIO pins exposed. It can control any of the boards described above, plus one new board to be published soon. The encoder is a 12mm incremental encoder from ALPS (EC12), Bourns (PEC11R), or similar.
 

Attachments

  • WM8816.zip
    2.3 KB · Views: 197
  • PGA2310.zip
    1.8 KB · Views: 228
  • MUSES72320.zip
    2.6 KB · Views: 261
  • spi knob.jpg
    spi knob.jpg
    136.2 KB · Views: 1,487
Member
Joined 2009
Paid Member
Now with the DS1882

As announced in my last post, here is one more volume controller. This one is based on the DS1882 digital pot, with the output buffered by matched JFETs, B1/Mezmerize style. The digital potentiometer, two JFET buffers and their analog power supply regulators are mounted on one 1100x1100mil (28x28mm) board.
 

Attachments

  • DS1882 - 5.jpg
    DS1882 - 5.jpg
    46.8 KB · Views: 1,479
  • DS1882 - 7.jpg
    DS1882 - 7.jpg
    38.7 KB · Views: 1,421
  • DS1882 - 9.jpg
    DS1882 - 9.jpg
    60 KB · Views: 604
Member
Joined 2009
Paid Member
A very nice project. It can be seen that the EMU 0204 has big problems with the distortion at higher frequencies.

Thank you!

Indeed, even though EMU0204 is a good and capable sound card, it is not quite up to the task of measuring the HF distortion of a low distortion line stage. I wouldn't call it big problems though - it is just that this line stage performs very well.
 
As announced in my last post, here is one more volume controller. This one is based on the DS1882 digital pot, with the output buffered by matched JFETs, B1/Mezmerize style. The digital potentiometer, two JFET buffers and their analog power supply regulators are mounted on one 1100x1100mil (28x28mm) board.

Hey Alex,

What’s the difference, if any, between your digital pot approach and a MDAC attenuator?

Thank you
 
Member
Joined 2009
Paid Member
do you have boards for the PGA2310? i need 6 channel balanced for my active crossover. thank you
Yes, I have the boards for all of the above volume controls. Just sent you a PM.
What’s the difference, if any, between your digital pot approach and a MDAC attenuator?
I think the main difference is resolution, in theory is easier to find DACs w/ higher resolution than digital pots. But I may be wrong.
You want a log relationship between the control code and the output level in a volume control, and a digital pot does just that. MDACs, on the other hand, generally have a linear relationship between the control code and the output level. While the number of steps may be higher (e.g. 256 in a 8-bit DAC vs. 64 in the DS1882), in terms of perceived volume these steps are more coarse at the low end, where you want them fine, and fine at the high end, where you don't need that. One can try to correct that in software, but it would reduce the effective resolution and increase complexity. There was an interesting chip, the AD7112 (see the attached datasheet), now obsolete, that did it in hardware.

Other than the resolution, the working principle of a digital pot (an R-string DAC) is different from that of an MDAC (that usually employs an R-2R ladder). You need to look at how an MDAC, a digital pot, a mechanical pot or any other control fits into your schematic. For example, a digital pot may be sensitive to loading - the reason I included a JFET buffer in the schematic above. For another example, a typical current output MDAC relies on an I/V converter, usually an opamp (again, see the attached datasheet for an example).
 

Attachments

  • AD7112.pdf
    567 KB · Views: 220
Last edited:
You want a log relationship between the control code and the output level in a volume control, and a digital pot does just that. MDACs, on the other hand, generally have a linear relationship between the control code and the output level. While the number of steps may be higher (e.g. 256 in a 8-bit DAC vs. 64 in the DS1882), in terms of perceived volume these steps are more coarse at the low end, where you want them fine, and fine at the high end, where you don't need that. One can try to correct that in software, but it would reduce the effective resolution and increase complexity. There was an interesting chip, the AD7112 (see the attached datasheet), now obsolete, that did it in hardware.
OK I get it. I wish the AD7112 was still in market, I would've preferred to control the steps via software (custom curve through lookup table, for instance).

In any case, seems like these digital pots have a very nice resolution. If I'm not mistaken, you can get 0.5dB steps on the WM8816, MUSES72320 and PGA2310, or 1/2/3 dB steps (depending on the position) for the DS1882.

Other than the resolution, the working principle of a digital pot (an R-string DAC) is different from that of an MDAC (that usually employs an R-2R ladder). You need to look at how an MDAC, a digital pot, a mechanical pot or any other control fits into your schematic. For example, a digital pot may be sensitive to loading - the reason I included a JFET buffer in the schematic above. For another example, a typical current output MDAC relies on an I/V converter, usually an opamp (again, see the attached datasheet for an example).

Still very interested in your approach. I'm reading through the datasheets. WM8816 for instance. Sorry again for the newbie following questions.

1. I'm assuming the microcontroller (Arduino, RPi...) knows at every moment not only the position of the encoder, which is sent to the pot, but also the attenuation generated by the pot (ie volume in dB), is that the case? I mean, I want to be able to show the real dB volume in the display.

2. Not really sure at all what the ±18V input signal refers to.

3. Gain range from -111.5dB to +15.5dB. Am I understanding correctly that we can attenuate the original DAC output but also have gain? (ie like attenuating from positions 0-128 and gain from 129-256, or whatever)

4. How is the output VRMS and Zout calculated?

Thank you so much again
 
Member
Joined 2009
Paid Member
1. I'm assuming the microcontroller (Arduino, RPi...) knows at every moment not only the position of the encoder, which is sent to the pot, but also the attenuation generated by the pot (ie volume in dB), is that the case? I mean, I want to be able to show the real dB volume in the display.
The datasheet for WM8816 (or any other volume control chip) defines the relationship between the gain/attenuation in dB and the code that you send to the chip. Your MCU can get the input from e.g. an encoder, display the dB number, calculate the appropriate code and send it to the volume control.
2. Not really sure at all what the ±18V input signal refers to.
WM8816 is unusual in that it handles +/- 18v input with only +5v power supply. Other chips, e.g. PGA2310 or DS1882, need analog supplies, and the input signal cannot exceed those analog supplies.
3. Gain range from -111.5dB to +15.5dB. Am I understanding correctly that we can attenuate the original DAC output but also have gain? (ie like attenuating from positions 0-128 and gain from 129-256, or whatever)
WM8816 has not one but two digital pots for each channel. These pots work together with an external opamp to provide gain or attenuation.
4. How is the output VRMS and Zout calculated?
Output Vrms = input Vrms * 20 * log10(dB gain). There are plenty of online calculators to do the math for you, for example, this.
Zout and current drive capability will depend on the opamp you use.
 
hey happy new year!

The datasheet for WM8816 (or any other volume control chip) defines the relationship between the gain/attenuation in dB and the code that you send to the chip. Your MCU can get the input from e.g. an encoder, display the dB number, calculate the appropriate code and send it to the volume control.
Ah OK, what I need then.

WM8816 is unusual in that it handles +/- 18v input with only +5v power supply. Other chips, e.g. PGA2310 or DS1882, need analog supplies, and the input signal cannot exceed those analog supplies.
I think it's cleaner if we use two power sources, one for digital and one for analog. Also, at least in PGA datasheets, they also recommend to have D/A ground planes separated, and they even place the pins favoring that design, which is cool.

WM8816 has not one but two digital pots for each channel. These pots work together with an external opamp to provide gain or attenuation.
Yes. I probably did not expose the question properly, excuse my english. What I want to know is, for instance, if I have a DAC outputting 1.2V RMS, I assume at minimum volume that will be 0V, at some point, it will be no attenuation so 1.2V, and from some point we get some gain, idk how much but let's imagine 2V?

Output Vrms = input Vrms * 20 * log10(dB gain). There are plenty of online calculators to do the math for you, for example, this.
Zout and current drive capability will depend on the opamp you use.
Noted.

Another question knocking my head, and sorry if it sounds very stupid question. I suppose the internal opamps do transform the audio signal (signal and noise) not only attenuate/amplify(gain) by changing the Vref, right? Where I'm going is, do these digital pots "have a sound"?

thank you again!