MiniVol PGA2320 Volume Control

Introduction

MiniVol is my effort at a very simple volume control board based on the excellent TI PGA2320 volume control IC, which offers impressive specs and can operate over a range of -95.5dB to +31.5dB. It utilises a small Atmel AVR microcontroller to control the PGA2320, and gives the builder the option of using either up/down pushbuttons or a rotary encoder as the user interface. The microcontroller's EEPROM is used to store the current setting between power cycles. Since the PGA2320 offers up to 31.5dB of gain, a jumper is provided to limit the control to 0dB. No additional functionality is provided, honouring the KISS principle. An external ±15V power supply is required, such as my MiniPow.

A dual-layer PCB design and firmware are available and free for DIY use. The PCB was designed to be small and modular, perfectly suited to a DIY amp or preamp project as an inexpensive and excellent-sounding alternative to a potentiometer or stepped attenuator. With two boards it can be used for a balanced configuration fairly easily (see build notes for details). SMD components are used almost exclusively, since the PGA2320 is available only in the SO-16 pacakage, and because size was a major design parameter. Parts cost without the PCB is about $25. If there is sufficient demand, I might consider offering boards and preprogrammed microcontrollers for sale.

The initial design thread at Head-Fi can be viewed here.

Schematic & Circuit Description

MiniVol schematic diagram

Power

MiniVol requires at a minimum a ±15V regulated supply, which is further regulated by an onboard 78L05 to 5V for the digital control section. An external 5V supply could be used if desired, by tapping ground and Vcc at the U1 position. Onboard decoupling consists of 150µF electrolytic in parallel with 100nF X7R ceramic for each chip on the digital supply, and 68µF electrolyic in parallel with 100nF X7R ceramic for the ± analog supplies.

Analog

This decoupled supply feeds the PGA2320, which has the source signal connected directly to its inputs. No buffering is provided onboard, though the PGA2320 should be driven by a source with 600Ω or lower output impedance.

Digital

An Atmel ATtiny24/44/84 provides digital control to the system, through six user interface pins. For input, two pins are exposed to provide for either UP/DOWN pushbutton input or a rotary encoder and a third pin provides for a mute button. Two 'jumper' inputs are provided as well: ENC selects whether an encoder or pushbuttons are in use, GN selects whether the PGA2320 should be capped at 0dB gain. All inputs utilise the AVR's internal pull-ups. MLED provides an output to drive a mute LED when the system is muted. An ISP connector is connected directly to the AVR's SPI port to facilitate programming. The SPI port is also connected to the PGA2320 through 10KΩ resistors.

PCB Layout

MiniVol PCB layout

In the image, blue areas are copper in the bottom layer, red areas are copper in the top layer, purple areas have copper in both layers, white areas are the top layer silkscreen. The main goal of the PCB layout was to separate the digital and analog sections as much as possible, and to keep both types of signals' current loops as small as possible. I believe both of these goals were achieved. Two unbroken ground planes are used per the PGA2320 datasheet, and connected at a single point with a ferrite chip; this point is directly below the 5V regulator's feed trace from V+ to keep the loop small and out of the way of the analog section. Signal-carrying traces are short and kept away from any digital signals - despite the fact that the microcontroller will be in sleep mode almost all the time. Two mounting holes are provided.

The board is 31.75mm x 43.18mm (1.25" x 1.7")

Parts

The table below lists parts for the MiniVol. Substitutions may be made at the builder's discretion; most values and part numbers are not critical. Detailed descriptions and substitutes are below the table.

Designator(s)QuantityDescriptionDigiKey #
Required onboard
C1-3, C74100nF 50V X7R Ceramic Capacitor399-1249-1-ND
C4, C6268µF 16V Electrolytic CapacitorP12921-ND
C5, C82150µF 6.3V Electrolytic CapacitorP12917-ND
R1, R3-7610KΩ resistorRHM10KERCT-ND
R211KΩ resistorRHM1.0KERCT-ND
U110.1A 5V regulator (78L05)LM78L05ACZFS-ND
U21Atmel AVR ATtiny24/44/84ATTINY24-20PU-ND
U31TI PGA2320 Volume Control296-17962-5-ND
Optional & Offboard
L11600Ω ferrite chip732-1623-1-ND
GAIN, ENC12x2 0.1" pin header (male)WM8138-ND
GAIN, ENC20.1" jumperS9001-ND
ISP12x3 0.1" pin header (male)WM8121-ND
U21DIP-14 socketED3314-ND
A, B1Panasonic rotary encoderP12334-ND
A, B, MT1 or 3Normally open momentary pushbuttonn/a
MLED1LED160-1667-ND

Capacitors

Resistors

Semiconductors

Optional Components

Firmware

Just a few quick notes at this time, I will post further if I get around to it. Sourcecode and binaries are available in the Files section.

The firmware is a rather over-the-top design. I am intending to use this basic model as a basis for several much larger projects, so I figured I may as well start here. It is largely interrupt driven, using timers. At startup, previous state is loaded from EEPROM and the device enters the main loop, which simply waits for an event to be dispatched, and processes them when they arrive. The core of the firmware is the scan interrupt, which runs every 1ms and samples the relevant inputs. After debounce, if changes are detected, the appropriate event is placed into a queue for processing by the main loop. A timer is started that will delay approx 1s and then write the current state to EEPROM. The timer is reset if any changes happen before it expires. This serves to save EEPROM write cycles. This interrupt also places the device in sleep mode when it is triggered. It's awakened again by a pin change interrupt on the input pins.

Notes

Files

High quality board layout and schematic
Altium Designer 6 design files
Gerber CAM outputs for PCB fabrication
Firmware sourcecode, BSD licensed
Firmware binaries in ELF format for ATtiny24, ATtiny44 and ATtiny84