A few times I have found the need to listen to multiple sources through headphones, without an easy way to achieve this. For instance, combining the output of an electric piano with some background music, or a phone call with music, or aviation radio with FM radio. Additionally, in some cases it would be helpful to have the ability to output to two headphones. For instance, to listen with a friend, or for music processing, or to compare the quality of two headphones. Combining this with the possibility to improve sound quality with appropriate amplification and a portable board (inspired by the inline processor on Bose headphones) the resulting amplifier which has three inputs and two outputs was called TRAMP.
Of the three inputs, two can be switched on and off, while the third has independent left and right level potentiometers for balance adjustment. Of the two outputs, one is on as long as the amplifier is on, while the other can be switched off to conserve battery.
This project consists of parts soldered to a single circuit board, batteries, and a cover which can be 3D printed or simply use any appropriately sized container. Links for the electronic parts on Mouser are provided.
The idea is to mix multiple audio input sources. The easiest way might seem to be to just connect them together, but this is problematic since the outputs of a device tend to maintain a set voltage so connecting multiple audio outputs will cause current to flow between them and not to the headphones. This can be circumvented somewhat by putting resistors on each audio input and combining the lines after that. That way the resistance is minimum going through the headphones and is double that going between any two devices. This works but the volume will always be reduced because of the resistance and the issue of giving extraneous current to an output still remains. A better option is to use an op-amp to combine the signal after it has passed through the initial resistors. In the given configuration the op-amp inverts the signal, so we use a second op-amp to invert it back to the original phase.
The schematic was based heavily on the suggestions from a page on all-electric-kitchen. The path for an input signal is through a capacitor, then a resistor, then to a mixing op-amp which provides a virtual ground. The mixing op-amp inverts the signal, which is then sent to an output op-amp that inverts it again. Both op-amps are unity gain, so ideally the output signal is a sum of the input signals. This configuration enables the mixing and output op-amps to be different, namely saving cost since the mixing op-amp does not need high output current capability. However here the same op-amp is used throughout for convenience. While the circuit may look complicated, it is a lot simpler if you recognize it is duplicated to handle the left and right channels of a stereo signal, and then duplicated/triplicated for the output and input sections. Some things to note: it uses film capacitors on the input since unlike MLCCs they do not have a problem with frequency response and linearity, the input filter (2uF and 10kOhm) has a low cutoff of about 5 Hz for passing even the lowest bass, high tolerance resistors are used for good stereo matching; the op-amp has a high slew rate, can operate at low voltage, is unity stable, and is capable of outputting to a short circuit; the amplifier uses the middle terminal of the batteries as ground for a true + and - supply so there are no output capacitors necessary, and there are hefty bypass capacitors to ensure low noise and ability to output high slope signals.
We start with the power and bypass sections of the board, having placed the op-amps:
The power section of the amplifier. The first switch turns the entire board on/off by connecting both the + and the - nets to the respective battery terminals. The central terminal (which is connected to both batteries) is ground and is always connected. The next section has the bypass capacitors for two of the op-amps. The final section has a switch that enables the third op-amp and its associated bypass capacitors.
Next is the rest of the circuit. Note the through-hole parts: three stereo inputs to which three cables will be soldered, two output jacks, and four switches - one for master power, two for two of the audio inputs, and one for the second output (the first is always on). The third audio input, which does not pass through a switch, instead passes through two potentiometers which enables independent control of the right and left signals to adjust balance and audio level on this input. Lastly, the battery holder has 4 terminals, and two of them are connected together to form the ground.
The rest of the components are surface-mount. These include the capacitors, resistors, and op-amps. The packages listed should be fairly easy to solder with a soldering iron, although here I used a hot air tool.
The main part of the amplifier. On left are the three inputs, each of which has 3 wires (L/R/Gnd). The first input goes through two potentiometers while the next two inputs go through switches. Then all go through their own capacitors and resistors, and are combined to a pair of mixer op-amps in inverting unity gain configuration. The mixer op-amp output goes to the two pairs of output op-amps which once again invert the combined signal and output it directly to the headphone jacks.
Next is the fun part of routing the board. The essential requirements for layout are to have the controls near the edge of the board and to have the bypass capacitors close to the op-amps. It is desirable to have a large ground plane to somewhat reduce noise pick-up, which I did not do at all. Enclosing this in a metal case might be a bit of a compromise.
The virtual routed board.
After drawing up the schematic and routing the board, I sent it off to a Chinese manufacturer for very cheap. Then I picked it up while traveling in China, coordinating which was a fun exercise. It was combined with a few other circuits on a larger board, and I cut out the amplifier board with a dremel.
The real routed board, front and back.
Next I soldered all the components together. I added a blob of hot glue to the input cables so they remain secure.
Board with components
Finally, I designed and 3D printed a case for the amplifier. I didn't design the snap lock properly and it broke off, so the case is held on with some tape.
Board with case
The amplifier was a big success! The board amazingly didn't require any changes, and had full functionality after assembly. The mixing worked as expected. What I did not expect was how much this improved the sound in my existing headphones. This is because the op-amps used are much nicer than what would be found in a standard soundcard, although they probably won't put out as much power. Being a unity gain amplifier, this device is best for listening with normal headphones at normal volume but higher fidelity (since the initial audio output, which probably has filter caps, will tend to attenuate the lower frequencies at higher current draw, and may not have a fast enough response for the higher frequencies). This device is not intended for hooking up to loudspeakers or for listening to music very loudly, and will not work well for that.
Testing with a Sony MDR-XB500, which has large over-the-ear drivers, the amplifier was seen to improve the high frequency response, making the music sound a lot cleaner. With an in-ear pair that had a smaller driver (Sony XBA-A2), the bass and mid response was improved. Everything sounded sharper, which I enjoyed but some might not. The quality difference was like getting an upgraded pair of headphones. The most improvement was noticed with my old laptop (which probably had a pretty standard soundcard for that time), the least with an iPhone 4 (which probably has a better audio output designed for headphones), so of course I would not claim that this improves an already good audio output.
Finally, this is a very sensitive amplifier, and it is designed for a linear response over a large frequency range, 10-100000 Hz. As such, with a subpar audio output you will hear high frequency 'white noise' amplified, which you might not hear if you plug in headphones directly to the audio output (the low headphone resistance will remove those signals, but the high amplifier resistance will allow them to be amplified and transmitted to the headphone). I was able to hear this noise on three of three computer sound outputs I have tested, but not on two of two mobile phones. Another concern is external noise, such as from a cellphone placed next to the amplifier, or even a person touching one of the input cables. The amplifier is able to pick up this signal which obviously affects audio quality. For the first case of the cellphone or other radio noise, it is possible to place the amplifier in a metal case, or to redesign the board taking into account analog design considerations like a ground plane. For the second case of noise on unused input cables (which is largely 60Hz for touching the input), it is possible to switch them off and remove this noise (which is the reason for including the switches), or alternatively to use this noise for fun electronics exploration.