For any audio amplifier circuit, a volume control is necessary. Basically, volume control circuit is a voltage divider circuit. Output from it is given to the main amplifier or to the mixer circuit. Generally, it is done by using a potentiometer to attenuate the input signal.
In digital systems, the volume control is done digitally, i.e. there is a kind of voltage divider circuit which can be controlled digitally. For sophisticated systems, there are special ICs available, but there is an easy way to do this.
A simple digital volume control can be done using CD4066 IC. CD 4066 is a quad CMOS Bi-lateral switch (For datasheet, click here). It is equivalent to 4 analog switches which can be con
trolled digitally. I used it to vary the attenuation of the signal by using a resistor bank.
As shown in the circuit diagram, the four switches are used to select the total resistance by turning the resistor on or off. As the resistance changes, the attenuation changes accordingly. When all the input bit are high, all resistances are bypassed by the switch and the attenuation is zero. Similarly, when all bits are low, it provides maximum attenuation. Also, this maximum attenuation can be changed by changing the resistor values. As there are four switches, there are a total of 16 (2^4) combinations or levels of attenuation.
This simple circuit is very useful in case when you need a simple yet good digital volume control.