REFERENCE SCHEMATIC 161

Using a DS1802 Pushbutton Digital Potentiometer to Create an Audio Preamplifier with Attenuator

© Jun 27, 2002, Maxim Integrated Products, Inc.

Abstract: This application note discusses how to best bias the AC signal to within the DC supply range and how to use digital potentiometers in circuits designed for mechanical potentiometers. This understanding is crucial to effectively using the DS1802 in a pushbutton-controlled audio preamplifier circuit.

Attend this brief webcast by Maxim on TechOnline
Attend this brief webcast by Maxim on TechOnline

Introduction to the DS1802 Dual Logarithmic Audio Potentiometer

The DS1802 audio potentiometer contains two digitally controlled potentiometers and features a logarithmic taper that produces a 1dB change per increment. The maximum attenuation is 63dB, but the device also contains a mute function that attenuates a signal greater than 90dB. Additionally, the DS1802 has four pushbutton inputs that can be used either as a volume/balance controller for stereo applications or for independent position control of the two potentiometers. The part also contains zero-crossing detectors, which, when used properly, can seamlessly change the volume to create a professional-sounding audio system. The part is available in 20-pin DIP, SOIC, or TSSOP packages.
The DS1802 is ideal for applications where pushbutton-controllable resistance is desired. It also has a 3-wire interface that allows a PC or microcontroller to control the potentiometers. This application note shows how to use the part, with a minimal amount of hardware, to create a preamplifier circuit with a pushbutton-controllable volume for two stereo channels.

Single Power Supply Audio Circuits

The first step in using the DS1802 is understanding how to bias an AC signal to within the DC supply range. This is required because the DS1802 will clip audio signals that attempt to go below GND or above VCC. The DS1802 can operate from a 3V or 5V supply, but be aware that selecting the supply voltage will affect the maximum audio signal swing that the part can handle. Since audio signals are generally symmetric, it is best to set the DC bias to VCC/2 to obtain the maximum audio signal swing.
The resistor-dividers, shown in Figure 1, can be used to set the DC bias of the input signal to VCC/2.
Figure 1. Resistors R1 and R2 add DC bias to an audio circuit.
Figure 1. Resistors R1 and R2 add DC bias to an audio circuit.
This circuit allows an AC signal to be passed across the middle resistor (or potentiometer) with the same DC bias on both sides. This is critical for a digital potentiometer because the zero-crossing detector switches the potentiometer's position when there is zero voltage across the end-to-end resistance of the potentiometer. As a result, there is no voltage potential across the digital potentiometer that would cause the pop typically heard when a digital potentiometer switches its location.
Three components critical to the performance of this circuit are shown in the AC and DC models in Figure 2. First, CIN must block the DC signal, which allows the DC bias to be set by the resistor network. Additionally, CIN must be sufficiently large to allow low-frequency signals to be passed onto the resistor network. If CIN is large enough, the system will have good performance over the entire audio range.
Second, the resistance across the two R2 resistors must be much smaller than the end-to-end resistance of the potentiometer. As a result, the AC signal is divided across the potentiometer and the two parallel R2 resistors. Conversely, if the resistance of the two R2 resistors is large, the majority of the AC signal could potentially be lost. This would decrease the signal-to-noise ratio of the system. Thus, it is advisable to make the resistance of the two R2 resistors relatively small. However, doing so will in turn affect the DC current of the system.
Last, the resistance of the two R1 resistors should be relatively large or the AC input impedance will be too low for practical use. Most consumer audio components have relatively high input impedances. The resistance of the R1 resistors and the end-to-end resistance of the potentiometer have the greatest effect on the AC input impedance of this circuit. The input impedance will not be affected that much by R2 or CIN because those impedances must be small with respect to the other two resistors for the circuit to work well.
Figure 2. The DC and AC models for the circuit in Figure 1.
Figure 2. The DC and AC models for the circuit in Figure 1.
The DC model of the circuit is easy to analyze because the input capacitor isolates the resistor network from any DC associated with the input. Also, the two ends of the potentiometer are both set at VCC/2, so no DC current will flow through the potentiometer. As a result, it is easy to determine the circuit's DC current consumption (see Eq. 4). It is the sum of the current flowing from VCC to GND through the two R1 and two R2 resistors. The equation has been mathematically simplified to a single fraction. Note that this does not account for the current of the DS1802, which will be small due to the digital portion of the chip.
RIN = (1/j2πfCIN) + R1||R1||(RPOT + R2||R2) (Eq. 1)
RIN_R = R1||R1||(RPOT + R2||R2) (Eq. 2)
g = 20log10[(RIN_R/RIN)(RPOT/RPOT + R2||R2)] (Eq. 3)
IDC = (VCC(2R1 + 2R2))/(4R1R2) (Eq. 4)
If you consider the AC model for this circuit, VCC will appear as an AC ground. The resistor is easy to analyze for impedance considerations. The formula for RIN is shown in Eq. 1. The formula for RIN_R, which is the impedance of the resistor network without the input capacitor, is shown in Eq. 2. In Eq. 3, the losses are proportional to RIN_R/RIN and RPOT/(RPOT + R2||R2). The RIN_R/RIN term accounts for the voltage drop from the input capacitor when feeding the input impedance of the circuit. The RPOT/(RPOT + R2||R2) term accounts for the losses associated with the voltage divider when the AC signal is divided across the potentiometer and the two resistors bias the low side of the potentiometer. If the impedance of CIN is large and R2 is small, there will be very little signal loss. Also, the only frequency-related signal loss is caused by the input capacitor, which creates a high-pass filter when coupled with the resistance of the input resistor network. If the impedance of the capacitor is relatively small compared to input resistor network, the AC signal will not exhibit frequency-related characteristics. Since the circuit has a tendency to filter low-frequency responses, it is wise to calculate how much loss will occur at 20Hz, which is at the low end of the audio spectrum. This calculation will show how well the circuit should handle the entire audio range.
Many very robust mechanical potentiometer designs are often modified to incorporate a digital potentiometer, but a common mistake when using a digital potentiometer is using it in the same way as a mechanical potentiometer. Figure 3 shows a simple circuit that can be used with a mechanical potentiometer, but will cause popping with a digital potentiometer.
Figure 3. A simple mechanical potentiometer circuit that will cause popping with a digital potentiometer.
Figure 3. A simple mechanical potentiometer circuit that will cause popping with a digital potentiometer.
The circuit in Figure 3 works with a mechanical potentiometer because the DC level of the output signal changes when the potentiometer is changed. The input side of the circuit will remain at a constant VCC/2 DC level (assuming R1 equals the end-to-end resistance of the potentiometer). When you change a mechanical potentiometer, the change is usually continuously variable and the DC output level changes slowly and continuously. Thus, COUT will allow the AC output signal to remain on DC ground. Conversely, a digital potentiometer instantaneously changes the position of the potentiometer. The step change in the DC level of the output will momentarily pass current through COUT. This will cause the popping sound typically heard with a poorly designed circuit, or with cheap audio circuits that use poor quality mechanical potentiometers that have inadvertent breaks in the resistance during resistance changes.
The other issue with using digital potentiometers in this circuit is that the zero-crossing detector does not work because the high side of the potentiometer (H) is bias to VCC/2 and the low side of the potentiometer (L) is tied to ground. Thus, unless the magnitude of the AC signal is VCC/2, H and L will never be at the same potential, and the zero-crossing detector will always timeout and switch when there is potential across the potentiometer.
Another example of incorporating a digital potentiometer in a mechanical potentiometer design is shown in Figure 4. There are several potential problems when converting this circuit to use a digital potentiometer. The input signal is referenced to ground via the potentiometer. If the input was an audio signal with 0V DC bias, negative signal voltages will be applied to the high side of the potentiometer. The DS1802 would clip signals below ground with its electrostatic discharge (ESD) structures. The maximum ratings of the DS1802 would imply that a -0.5V signal would not be a problem. However, the DS1802's ESD-protection circuits are active whenever signals are below GND or above VCC. Although it will not hurt the part, negative signal voltages cause distortion of the audio signal. Also, this circuit works for the zero-crossing detector if both ends of the potentiometer are biased to 0V DC. However, the lack of negative signal swing could cause the circuit designer to decide to bias the input to VCC/2.
Figure 4. Example of a mechanical potentiometer circuit converted for  digital potentiometer use.
Figure 4. Example of a mechanical potentiometer circuit converted for digital potentiometer use.
Once the input is rebiased, the same zero-crossing problem seen in Figure 3 occurs. The high and low sides of the potentiometer are now at different DC potentials, and the instantaneous DC level change at the wiper will propagate through C1 to the output.
To use a digital potentiometer in a circuit designed for a mechanical potentiometer, think through all of the DC operating points and AC signal paths. The parts of the circuit are easy to use. However, if they are used with a digital potentiometer, they become active components and, in order to achieve good results, must be used according to the specifications in the data sheet.

Example Stereo Preamplifier with Pushbutton Volume Control

In addition to biasing the audio signal to a DC level of VCC/2 and keeping the high and low sides of the potentiometer at the same DC potential, there are a few more points to consider when using the DS1802 for audio attenuation. The input impedance of the input resistor network must be large enough so that an external source can drive the signal into the preamplifier. Also, the input capacitor must be large enough that it does not attenuate the low-end frequency response, and the resistance of the R2 resistors must be small enough that it does not attenuate the signal across the digital potentiometer.
The circuit shown in Figure 5 has minimal signal loss and good frequency response.
Figure 5. Preamplifier circuit with pushbutton attenuator.
Figure 5. Preamplifier circuit with pushbutton attenuator.
This circuit yields an input impedance of greater than 13.7kΩ. The signal loss due to the two parallel R1 resistors, the potentiometer, the two parallel R2 resistors, and the input capacitor at 20Hz is 1.2dB. At best, most full-range speakers have a frequency response down to 50Hz, and the input attenuation at 50Hz is 0.6dB. Also, note that since the DS1802 internally debounces input switches, the momentary switches are only connected to ground. The switching configuration shown in Figure 5 only provides volume up, volume down, and mute control for the audio signal. The DS1802 data sheet shows how to configure the part for a stereo controller and how to independently control the potentiometers using the pushbuttons, if that functionality is desired. Also, note that VCC is decoupled with a capacitor near both the DS1802 and the MAX4167 operational amplifiers. This improves the system's audio performance by limiting supply fluctuations. The operational amplifiers are required in this circuit because the DS1802 has a relatively high wiper (output) resistance. Without buffering, the DS1802 can only drive a 1mA load. Additionally, if the load is capacitive, the high output resistance will cause the attenuator to filter out high frequencies. Since the operational amplifier has a high input impedance, it does not load down the potentiometer and is capable of providing a reasonable amount of drive current to the next amplifier stage. The two C3 capacitors are required to allow the next stage of the amplifier to rebias the DC level of the audio signal. They are not required if an input capacitor is present at the next stage or if the next stage operates at the same DC bias level.
An alternative way to attain the VCC/2 bias level is by using a voltage reference. A voltage reference can store the current dissipated by the 2kΩ (R2) resistors (see Figure 5). In Figure 6, a 2.5V reference is used for a 5V VCC.
Figure 6. VCC/2 bias provided by series (A) and shunt (B) voltage references.
Figure 6. VCC/2 bias provided by series (A) and shunt (B) voltage references.
The R1 and R2 resistors in Figure 6 can be any reasonable value that reduces the size and value for CIN. CL has to be large enough to pass the lowest AC audio frequency desired.

Summary

This application note discussed key points for the effective use of the DS1802 as an adjustable audio preamplifier circuit. In biasing the AC signal to within the DC supply range, designers need to think through all of the DC operating points and AC signal paths. Also, although it is very common to use digital potentiometers in circuits designed for mechanical potentiometers, the effects from the different potentiometers need to be considered in order to achieve the desired results.


Related Parts
DS1802 Dual Audio Taper Potentiometer with Pushbutton Control Free Samples  
MAX4167 High-Output-Drive, Precision, Low-Power, Single-Supply, Rail-to-Rail I/O Op Amps with Shutdown Free Samples  
MAX6043 Precision High-Voltage Reference in SOT23 Free Samples  
MAX6138 0.1%, 25ppm, SC70 Shunt Voltage Reference with Multiple Reverse Breakdown Voltages Free Samples  


Next Steps
EE-Mail Subscribe to EE-Mail and receive automatic notice of new documents in your areas of interest.
Download Download, PDF Format (193kB)  
Share
Other Channels  Email this page to an associate or friend. 


The content on this webpage is protected by copyright laws of the United States and of foreign countries. For requests to copy this content, contact us.

APP 161: Jun 27, 2002
REFERENCE SCHEMATIC 161, AN161, AN 161, APP161, Appnote161, Appnote 161