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
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
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) | Quantity | Description | DigiKey # | |
---|---|---|---|---|
Required onboard | ||||
C1-3, C7 | 4 | 100nF 50V X7R Ceramic Capacitor | 399-1249-1-ND | |
C4, C6 | 2 | 68µF 16V Electrolytic Capacitor | P12921-ND | |
C5, C8 | 2 | 150µF 6.3V Electrolytic Capacitor | P12917-ND | |
R1, R3-7 | 6 | 10KΩ resistor | RHM10KERCT-ND | |
R2 | 1 | 1KΩ resistor | RHM1.0KERCT-ND | |
U1 | 1 | 0.1A 5V regulator (78L05) | LM78L05ACZFS-ND | |
U2 | 1 | Atmel AVR ATtiny24/44/84 | ATTINY24-20PU-ND | |
U3 | 1 | TI PGA2320 Volume Control | 296-17962-5-ND | |
Optional & Offboard | ||||
L1 | 1 | 600Ω ferrite chip | 732-1623-1-ND | |
GAIN, ENC | 1 | 2x2 0.1" pin header (male) | WM8138-ND | |
GAIN, ENC | 2 | 0.1" jumper | S9001-ND | |
ISP | 1 | 2x3 0.1" pin header (male) | WM8121-ND | |
U2 | 1 | DIP-14 socket | ED3314-ND | |
A, B | 1 | Panasonic rotary encoder | P12334-ND | |
A, B, MT | 1 or 3 | Normally open momentary pushbutton | n/a | |
MLED | 1 | LED | 160-1667-ND |
Capacitors
- C1-C3, C7: 100nF 50V ceramic capacitor (X7R)
- 1206 SMD Package
- Used for decoupling digital and analog supplies near ICs. Substitute any suitable 1206 capacitor; voltage must be rated 16+V.
- Recommended part: Kemet C1206C104K5RACTU 0.1µF, X7R, 50V, ±10%
- C4, C6: 68µF 16V electrolytic capacitor
- 2mm spacing, 5mm diameter
- Used for decoupling analog supplies. Substitute any electrolytic capacitor that will fit; voltage must be rated 16+V.
- Recommended part: Panasonic FM series EEU-FM1C680 68µF, low ESR, 16V
- C5, C8: 150µF 6.3V electrolytic capacitor
- 2mm spacing, 5mm diameter
- Used for decoupling digital supply and to capacitively load U1. Substitute any electrolytic capacitor that will fit; voltage must be rated 6.3+V
- Recommended part: Panasonic FM series EEU-FM0J151 150µF, low ESR, 6.3V
Resistors
- R1, R3-R7: 10KΩ resistor
- 1206 SMD Package
- Used to damp digital signals and isolate ISP
- Recommended part: Rohm MCR18 series MCR18EZPJ103 10KΩ 5% 1/4W
- Higher quality part: Vishay/Dale CRCW1206 series CRCW120610K0FKEA 10KΩ 1% 1/4W
- R2: 1KΩ resistor
- 1206 SMD Package
- Current limit resistor for MLED
- Recommended part: Rohm MCR18 series MCR18EZPJ102 1KΩ 5% 1/4W (delivers ~3mA to recommended MLED)
- Higher quality part: Vishay/Dale CRCW1206 series CRCW12061K00FKEA 1KΩ 1% 1/4W
Semiconductors
- U1: 0.1A 5V regulator (78L05)
- TO-92 Package
- Regulates V+ input to 5V for Vcc digital supply voltage.
- Recommended part: Fairchild LM78L05ACZ 0.1A, 5V, 5%
- Higher quality part: National LM78L05ACZ/NOPB 0.1A, 5V, 5%
- U2: Atmel AVR ATtiny24/44/84
- DIP-14 package
- Provides control signal to U3 and monitors pushbutton/encoder inputs
- Recommended part: Atmel ATtiny24-20PU 2KB flash AVR
- Substitutes: ATtiny44-20PU (4KB flash), ATtiny84-20PU (8KB flash)
- U3: TI PGA2320 Volume Control
- SO-16 package
- Programmable gain amplifier, variable from -95.5dB to +31.5dB in 0.5dB steps. Performs volume control.
- Recommended part: Texas Instruments PGA2320IDW
- Susbstitutes: Texas Instruments PGA2310U
- Note: DigiKey has Non-Stocked this part, but it seems you can still order it in ones from them. Otherwise it can be sampled directly from TI.
Optional Components
- L1: 600Ω ferrite chip
- 1206 SMD Package
- Couples analog and digital grounds. I'm not sure of the benefit, if any.
- Recommended part: Wurth 74279218 600Ω 2A
- Omit by: Jumper L1 position
- GAIN/ENC: 2x2 pin header (male)
- 0.1" pin spacing
- Jumper header to select gain and input settings
- Recommended part: Molex 90131-0762 2x2 0.1" spacing 0.266" height
- Omit by: Wire jumpers to select settings
- GAIN/ENC: Shorting jumper
- 0.1" pin spacing
- Jumper to select gain and input settings
- Recommended part: Sullins SPC02SYAN 0.1" jumper
- Omit by: Wire jumpers to select settings
- ISP: 2x3 pin header (male)
- 0.1" pin spacing
- Header for in-system programming
- Recommended part: Molex 90131-0123 2x3 0.1" spacing 0.266" height
- Omit by: Wires to ISP programmer or external IC programming (preprogrammed IC)
- U2 socket: DIP-14 socket
- DIP-14 package
- IC socket for U2
- Recommended part: Mill-Max 110-93-314-41-001000 machined gold plated DIP-14
- Omit by: Solder U2 directly to board
- A, B: 2-bit quadrature rotary encoder
- off-board
- Rotary encoder for volume setting
- Recommended part: Panasonic EVE-KC2F2024B 24 pos. mech. encoder with detent
- Alternate part: Grayhill 62P22-L0 16 pos. optical encoder with detent (requires an additional resistor and +5V supply)
- Omit by: Using pushbuttons
- A, B, MT: Normally-open momentary pushbutton
- off-board
- Pushbuttons for volume setting and mute
- Recommended part: No recommendation given
- Omit by: Use rotary encoder, and omit mute function
- MLED: LED
- Mute indicator LED, will be lit when system is muted. Choose R2 to match selected LED.
- Recommended part: Lite-ON LTL42KE6N 3mm red LED
- Omit by: omitting
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
- Drive PGA2320 from a low-impedance source, per the datasheet. This probably means you need a buffer for the input to this circuit.
- For balanced configuration, two boards are needed. One board should be fully populated and serves as the controller. The other, slave board must be partially populated. The following parts should be omitted: C7, C8, R2, U2, and the ISP, switch, MLED, and configuration headers. Install a socket in place of U2. You should then stack the boards, with the master board on top. Use stiff leads or header pins to extend the pins of U2 and connect them to the socket on the slave board below. The following U2 pins must be connected: 7, 8, 9, 10. Do not connect any other U2 pins between boards. The digital controls of the slave board are now connected to the master board, and it should follow the master board exactly.
Files
minivol.pdf | High quality board layout and schematic |
minivol_altium.zip | Altium Designer 6 design files |
minivol_gerber.zip | Gerber CAM outputs for PCB fabrication |
minivol-src-1.0.zip | Firmware sourcecode, BSD licensed |
minivol-elf-1.0.zip | Firmware binaries in ELF format for ATtiny24, ATtiny44 and ATtiny84 |