Little Fish Logo LITTLE FISH BICYCLES
CONTACTHOME

A HiFi Preamp

Recently I've become a little obsessed about upgrading my stereo. It all started when I was given a gorgeous pair of Infinity RS-5b speakers, of mid '80s vintage, complete with rotted surrounds on the woofers. These were brought up to scratch quite easily by replacing the surrounds with a kit bought from ebay, allowing me to hear the limitations of my Sharp 3-in-1 stereo with utmost clarity.

Rather than go out and buy a Yamaha/NAD/Denon/whatever receiver or amplifier, I figured I'd roll my own. What started out as a simple integrated amp turned out into something a little more. At present it's a pre/power amp pair. The power amp (the really boring box on the bottom)is based on David Tilbrook's AEM6000 Ultra-Fi design, with some newer transistors here and there and a redesigned PCB to allow for flatpack MOSFETs.

Old magazines weren't of much use in providing inspiration for a preamp, as they generally get frightened at the prospect of programming micros. I have no such fear. I sat down for a bit and thought about what I really wanted a preamp to do.

I came up with some nominal specifications:

  • Stereo. Whilst I'll use it for watching movies, my flat just doesn't have the room for a full set of surround sound speakers. My main motivation is listening to stereo music sources, so a stereo amplifier is appropriate.
  • Heaps of inputs. There's nothing worse than not having enough inputs. At the moment we have a CD player, DVD player, tuner, TV set top box, and video recorder. We'll probably get a home theatre PC shortly, and having a tape and line level phono input never hurt anyone. That's eight stereo inputs.
  • Ability to switch video sources as well. No need for all eight, but the DVD, TV, video, and PC inputs will do video as well. I'm not a big video junkie, so S-video is oodles good enough. I can get passive filters to convert from composite to S-video.
  • Very low distortion. This is relatively easy to achieve in a preamp, as the power levels are low. As with the power amp, I decided 0.001% (100dB) THD and intermods was a reasonable target.
  • Moderate cost.
  • Good looks. I'm a bit of a perfectionist in this regard.
  • Useability. I want it to be as simple as possible to use, with a simple volume knob, and a button to select each input. Remote control is a must, so it needs some sort of display (that's viewable from across the room) to show what it's up to.

Research

I started by searching the net for information on IR protocols. Rather than build a remote control, I figured that if it uses standard signals, then I could use a universal remote to control it (as well as my other gear). I found a whole preamp design by Mark Hennessy, which is quite close to what I want to do. Mark's preamp uses a a Burr-Brown PGA2310 volume control IC rather than the more usual potentiometer, with relay's to select the source and tape monitor, and OPA2134 buffers. The front panel features a gorgeous graphical VFD to show you what's happening, and a rotary encoder to control the volume. There's also an IR receiver, to allow the whole thing to be controlled remotely.

Design

This design was pretty much spot on what I wanted to do. All I needed to do was simplify the audio side a little (by removing the surround channels and the independent tape relays), and add some video switches. I also added an NE5532 to buffer the line level outputs, and removed the buffer on the output of the PGA2310, as the input impedance of my power amp is fairly high, so it wasn't needed.

The PGA2310 is a pretty neat chip. It's capable of attenuating a stereo source over a 127dB range (-95.5dB to +31.5dB) with 0.5dB steps. It has a maximum gain error of +/-0.05dB, and THD of 0.0004% at 1KHz. The sweet spot between THD and noise appears to be between 3V RMS and about 8V RMS. I thus put 6dB gain in the input buffer (an OPA2134), so that the full-scale input is around 4V RMS with my CD player (2V RMS full-scale output).

I used signal relays to select the inputs. If I was doing it over, I'd probably use some Analog Devices SSM2404 FET switches. However, at the time I laid it out I didn't know about the SSM2404, so the relays will have to suffice.

The preamp is separated into six PCBs in total. They are:

  • Preamp analogue board. This board contains the input and output phono sockets, source select relays, buffer opamps, and volume control chip.
  • Preamp video board. This board contains the s-video input andoutput sockets, video select switches, and video buffers.
  • Control board. This board attaches to the front panel, and contains the microcontroller to control everything, a graphical vacuum fluorescent display to display source and volume, source select and power pushbuttons, relay drivers, and IR receiver.
  • Power switch board. This board contains a 5V power supply for the control board, plus some power relays to switch the mains under control of the micro. There's also a soft-start circuit.
  • +/-18V supply for analogue board. A simple regulated power supply for the analogue board. The analogue board has its own regulators, but having a second set doubles power supply rejection, ensuring that horrid junk on the mains doesn't make it through to the speakers. It's overkill in the extreme, but then so is most audio design.
  • +/-5V supply for video board. A simple regulated power supply (actually a duplicate of the analogue power supply board with some different components) to supply the video mux board.

The audio signal path is shown below. A set of eight signal relays are used to select the source, which is then buffered by an NE5532 for the line level outputs, and an OPA2134 for the monitor output, with a gain of 2 (6dB), followed by a PGA2310 volume control IC. Gain is adjustable from -89.5dB to +37.5dB. Given the +/-15V supplies, a 1V RMS input will clip with the gain set to about +18dB. In order to ensure that the poweramp doesn't clip with my CD player (2V RMS output), the gain shouldn't be driven beyond +6dB (0dB setting on the PGA2310).

The line level outputs are DC coupled, and have no bandwidth limiting components. The monitor output has a single pole low-pass at 160KHz, and a high-pass at 3.4Hz. The gain is flat within 0.1dB from 20Hz to 20KHz.

The video switch uses a pair of MAX4314 quad video muxes to select luminance and chrominance inputs from one of four s-video cources. The selected luminance and chrominance signals are then buffered using a pair of MAX497 video drivers. The MAX4314 and MAX497 each have 6dB gain. With the impedance matching resistors, the circuit as a whole has unity gain. The circuit should be flat within 0.1dB to 87MHz (dictated by the MAX4314), so won't degrade video signals.

The front panel is controlled by a PIC16F877 microcontroller. Port D is used as a data bus, and is shared by the VFD, source select pushbuttons, volume control (clock and data), and relay driver. A power switch IC is used to switch 5V power for the VFD, source select relays, rotary encoder, and source select pushbuttons. This switched 5V line is used as an enable for the power switch board.

As I mentioned in the intro, this amplifier (and the accompanying preamp) is destined for my loungeroom. It's thus important that it look good with my other stereo gear. I used Autocad to design the enclosures, along with the emachineshop software for the front panels.

The sides are made from thick aluminium sheet. The top, bottom, and rear are simple painted steel sheets, and the front is an (expensive) milled aluminium block, shaped and anodised to look good with my NAD tuner, CD player, and DVD player.

When paired with the matching poweramp, the whole assembly should look quite good.

I actually balked at the cost of the front panel from emachineshop, and got one made by front panel express instead. It was significantly cheaper, but was only 4mm thick. It's also anodised before being milled, which means the edges are raw aluminium. Looks okay though. I cut a piece of red acrylic to go in front of the vacuum fluorescent display, which gives it a lovely red glow.

This is a work-in-progress. I'll post stuff up here as I do it.

Preamp board:

Control board:

Here's a few pictures taken while developing the code for the PIC micro. I really like the display.

Next, some code to control the whole thing. The source code is written in Hitech PICC lite (a free C compiler for PIC micros). I used Microchip MPLAB IDE to manage everything, and did the debugging with a Microchip ICD2 debugger. At the moment (13 May 2006) the following bits work:

  • The power button.
  • The vacuum fluorescent display (see above).
  • The source select buttons and relays.
  • The rotary encoder and serial data outputs to the PGA2310.
Stuff that still needs attention are:
  • IR receiver routines - there's a raw receiver routine but nothing to decode the packet.
  • Adding 6dB to the volume output to account for the gain in the OPA2134.
  • Optimising stuff and cleaning up the code. The code is pretty messy at the moment.
There's a minor error with the board that has to be fixed before the source select relays will work. The output enable line on the 74HC374 is connected to VCC on the board, but should be connected to ground in order to enable the outputs.

Anyway, here's the code, warts and all:

LITTLE FISH