Introduction: Equalised Headphone Amp for Hearing Impaired

My needs

Some months ago I was fitted with hearing aids to compenste for a loss of sensitivity to high frequencies, causing sounds to be muffled and a difficulty distinguishing sybillants (e.g. "S" and "F"). But the aids give no benefit when using headphones since the microphones are behind the ear. After experimenting with an induction neckloop and direct input to my hearing aids (neither of which gave satisfactory results) I came up with the idea of a headphone amplifier with an adjustable frequency response designed to match that of my hearing aids.

If you have some other requirement for equalisation then this project could be easily adapted. It provides boost (or cut, with a trivial modification) at 3 centre frequencies. However, it could be extended to more frequency bands.

The result

What I ended up with was a neat little 6cm square box with 3.5mm jack and Bluetooth inputs and a 3.5mm jack headphone output. I found the improvement in the listening experience for music to be spectacular, and a great improvement for speech.

What this Instructable will give you

Let me state at the outset, this is not a beginner's project. You will need a reasonable level of soldering skills, and if you want to modify it (as you may well) you will need to learn Eagle for the board layout and TinkerCAD for the 3D-printed box. Both took me a little while to master but neither was hard. I expect people to learn something from my Instructables (unless you already know more than I do), not to just blindly follow instructions.

If you've never soldered surface mount components, don't be put off - it's not as hard as you might think. See this guide for an introduction.

What you'll get from this project is:

  • Eagle design files (schematic and board layout)
  • An Excel spreadheet embodying the design equations to allow you to customise the equalisation to your needs
  • The TinkerCAD design for the 3D printed box.

Step 1: The Design Process: Requirements and Strategy

When I started thinking about this project, one of the first questions in my mind was whether to use analogue or digital filters. In a thread on the All About Circuits forum, Keith Walker alerted me to a very cheap (analogue) graphic equaliser from the Far East (illustrated above) which he had used to solve the same problem. So I ordered one as a proof of concept.

It worked well but was too bulky for portable use, and needed both positive and negative power rails, an added inconvenience. But it confirmed the approach, and the type of filter circuits to use.

I refined my requirements to the following:

  • It must be compact, portable and powered by a rechargeable battery.
  • It should accept input from either a 3.5mm jack or Bluetooth.
  • It must have separate left and right stereo channels.

I've used conventional through-hole components and 0.3" DIL ICs on stripboard in many previous projects, but this would have made it too bulky. So I decided I would have to design a custom PCB (a new experience for me) using surface mount components (of which I have some modest experience). I would also have to design a 3D-printed box (my 3D design experiencce was very limited).

A Bluetooth capability would be easy to add using any of the various cheap Bluetooth modules which are available.

There are 2 or 3 dedicated graphic equaliser ICs which I looked at, but using cheap quad opamps seemed in the end simpler and required only as many external components.

Step 2: Detailed Design

The basic circuit element I used is known as a gyrator. It uses an operational amplifier to turn a capcitor into a virtual inductor. This, and one more capacitor makes a tuned circtuit, providing either cut or boost over a certain range of frequencies. Very many graphic equaliser designs use a virtually identical design and there is no point in departing from it. They are exemplified by this one from Electronics Today International September 1977 page 27. This article explains very clearly how the circuit works.

I only modified it by using quad opamps which would run from a single 5V supply, and by adding a headphone amplifier IC to ensure that it would adequately drive headphones. I also replaced each potentiometer by a potentiometer and a resistor so as to give boost only and finer control, since I didn't need cut.

The schematic and board layout (both generated using Eagle) are shown above.

A great feature of Eagle is that it includes the Spice circuit simulation package, making it possible to validate the design and to predict the frequency response before committing to manufacture of the PCB.

The board provides 2 inputs, a 3.5mm jack socket and solder pads for connection of a Bluetooth receiver module. These are effectively in parallel. Power can be supplied either through a mini-USB socket or solder pads. I used mini rather than micro-USB since a micro-USB socket would be quite hard to hand-solder, and also is less robust.

Step 3: Eagle Install and Set-up

If you want to send the board design for manufacture, modify the layout or simply modify the response curve you will need to install Eagle. If (like me when I started this project) you're not familiar with it, the SparkFun website has a series of helpful tutorials at https://learn.sparkfun.com/tutorials/tags/eagle

The first one to look at is How to install and setup Eagle.

This includes installing the SparkFun libraries. The downloaded zip file contains a folder SparkFun-Eagle-Libraries-master which you should copy to EAGLE\libraries

You also need to import my Eagle schematic and board layout files, and my Spice models. (Spice is the circuit simulation software which enables us to simulate the frequency response of the amplifier.)

These are all included in a zip file which you can download from

https://github.com/p-leriche/EqualisedHeadphoneAmp

Open the zip file and drag and drop the projects and spice folders into your EAGLE folder. (It will already contain an empty projects folder.)

You should now be ready to launch Eagle.

In the left hand pane, open up Projects, then projects, then Equalised Headphone Amp.

Double-click the Headphone_Amp.brd and Headphone_Amp.sch files. These will open in separate windows, the first showing the board layout and the second the schematic.

On the schematic, find and click the Simulate button.

This opens the Simulation setup. Click the AC Sweep radio button, set the Type to Dec (the default), and the Start and End Freq to 100 and 10000 respectively. Click the Simulate button at the bottom right. After a pause a graph of the frequency response should appear, just as shown in the next step.

Step 4: Tweaking the Response Curve

Your ears will very likely be different to mine, so first of all you need a copy of your audiogram. Your audiologist should be able to supply you with this, but if you have a good pair of headphones you can make your own by going to https://newt.phys.unsw.edu.au/jw/hearing.html

This should give you a good idea of how much boost you need at different frequencies. In my case, my hearing loss increases rapidly above 3kHz, making it infeasible to compensate much above that. In any case, a few experiments analysing the spectrum of various sources with Audacity indicated that there probably wasn't much above that for me to be missing.

As it stands, the project allows you to adjust the frequency response at 3 centre frequencies of 1.5, 2.3 and 3.3kHz, independantly between the left and right channels. You can stick with these frequencies, or change them (see the next step).

In your EAGLE\spice folder you will find models for the 3 trimpots POT_VR111.mdl, POT_VR121.mdl and POT_VR131.mdl. These control the response at the 3 frequencies. Opening any of these with a text editor (e.g. Notepad) will see a line such as:

.param VAR=50

Change the number to anything between 0 and 100 to represent the position of the corresponding trimpot and hence the boost at that freqency to anything from zero to maximum.

Now re-run the simulation (click Update Netlist before clicking Simulate) to see how what the freqency response now looks like.

Step 5: Changing the Centre Frequencies

In the Eagle Project folder, I've included an Excel spreadsheet Calc.xlsx. Open this with Excel (or if you don't have Excel, LibreOffice Calc, which is free). This spreadsheet embodies the design calculations for just one of the 3 filter sections.

The first box allows you to calcuate the centre frequency and Q factor for given values of R1, R2, C1 and C2. (The Q or Quality factor determines the width of the band. A higher value gives a narrower band and more boost. Values around 4 seem to work well if each frequency is roughly 50% greater than the previous.)

In fact you are more likely to want to choose the frequencies and calculate the component values. Given a desired frequency and three of the four component values, the second box allows you to calculate the 4th component value.

Components come in preferred value (for example the E12 series), so you can choose the nearest preferred value to the calculated value and feed this back into the first box to see what actual frequency that gives.

You then need to plug your values into the Eagle schematic and repeat the simulation.

Bring up the schematic, and in the left hand panel, click the component value icon then click the component you want to change. (The simulation is set up to operate just on the lower or left channel.) You will get a warning saying the component has no user defineable value. Do you want to change it? Of course you do! Enter the new value in the box that pops up.

Click the Simulate button, clicking Update Netlist then Simulate.

Step 6: Components Required

You will, of course, need a circuit board. Unless you use one of my spare bare boards you will need to send the Eagle files for manufacture. Most manufacturers require the design as a set of gerber files. Rather than duplicating the instructions here, search online for Eagle export gerber or refer to the Sparkfun tutorial.

Separate gerber files describe the copper layers, the solder mask, the silk screen printing, the drilling and the milling of the board outline.

In submitting the files online to a manufacturer it will validate them and alert you if any essential files are missing. But it won't alert you if a silk screen file is missing, which was my mistake. This is separate from the device outlines.

You will need the following components to populate the board.

  • TL084 SOIC-14 quad op amp - 2 off
  • LM4880M SOIC 250mW power amplifier - 1 off
  • 0603 SMD resistor assortment
  • 0603 SMD ceramic capacitor assortment 100pF - 1μF
  • 5K Trim Pot 3362P-502 - 6 off
  • 10uF 16V SMD 0805 Multilayer Ceramic multilayer capacitor - 4 off
  • 2917 (EIA7343) 100μF 16V tantalum capacitor - 2 off
  • 2917 (EIA7343) 470μF 10V tantalum capacitor - 2 off
  • Mini USB Female 5-Pin SMD Socket
  • 3.5mm through-hole PCB mount stereo audio jack - 2 off
  • 3mm blue LED (or your choice of colour)

For a complete battery-powered unit with Bluetooth input you will additionally need:

  • Bluetooth receiver module supporting A2DPsuch as this
  • LiPo battery: 503035 3.7V 500mAhr
  • TP4056 LiPo charger with mini-USB input (or microUSB if you prefer) such as this
  • 3V - 5V boost converter such as this
  • Mini SPDT slide switch

NB The LiPo charger is likely to be set for a 1A charge current, which is too much for a 500mAhr battery. It's important that you remove the charge rate programming resistor (normally 1.2K connected to pin 2 of the TP4056 chip) and replace it with one of 3.3k.

I used a wire-ended LiPo battery, but one with a miniature JST connector would allow it to be connected only after wiring up and double checking everything else, as well as making it easier to replace.

A Bluetooth module which will run on either 3.3V or 5V is preferable as it can then take its supply direct from the battery, reducing digital noise on the 5V supply to the main circuit board.

If you choose a Bluetooth module supporting AVRCP as well as A2DP you could add push buttons for volume up/down and next/previous track.

Many Bluetooth modules have a surface mount LED to indicate the connection state, and the TP4056 charger has red and green surface mount LEDs to indicate the charge state. A box such as the one I made will probably hide these, so they can be replaced (see later) by:

  • 3mm blue LED
  • 3mm red/green common anode LED.

Step 7: Using a Prototype Bare Board

If you have obtained one of my spare prototype boards there are just a few minor errors you need to be aware of.

  • There is no silk screen on the top of the board. You will find it helpful to have a printed copy of the board layout to hand as you populate it.
  • A couple of vias were meant to link the top and bottom ground planes which don't. This is of no consequence.
  • C3 was originally 100uF, in a 2917 package. This value was much too large and is now 1uF 0603. You will need to scrape away a little of the solder resist from the ground plane in order to fit this, as shown in the photo.

The gain is set by the values of resistors R106 and R206. 22k gives roughly unity gain. Since you might want to experiment with different values, I provided both 0603 SMD resistor pads, and holes at 0.3" pitch for wire-ended resistors.

Step 8: Boxing It

You can find the 3D-printable design for the box I used at tinkercad.com. The clearances were a little too tight so I've increased the length and width of the box by 1mm.

The bottom of the box provides compartments for the battery, the charger, the 5V boost converter and the Bluetooth module. The headphone amp board fits on top. The lid is retained by two M2x5mm self-tapping screws.

Identical charger and 5V boost modules are widely available but there are many different Bluetooth modules. If any of these are different from mine you'll need to modify the box design.

Once in place, you can lightly retain the modules with hot melt glue.

Step 9: Wiring It Up

For testing purposes I attached all the modules to a piece of cardboard using blu-tac. From this I found that the routing of the ground connections was critical. The ground from the Bluetooth module must be taken to the headphone amp along with the let and right channels, but then the ground connection from the distribution board must go to the Bluetooth module, not the headphone amp, otherwise you get a lot of digital noise from the Bluetooth module in the output.

I mounted the on/off switch on a small piece of stripboard, 6 strips wide by 5 long and with a 2x4 cutout for the switch. This also serves as a power distribution board. When it was fully wired up I glued the switch into place (with the stripboard attached) using epoxy glue. If I were re-doing the project I'd make provision for the switch on the headphone amp board.

You need fairly thin stranded wire for wiring it up so I split a length of rainbow ribbon cable, which gave me individual wires of different colours. Normally you would pass the wires through a hole in a board and solder it on the other side, but with the various modules in place in the base of the box I had to solder to the same side of the board as the wire entered from, with just a little more insulation stripped than otherwise would have been necessary. I had to mount the stripboard copper side up and solder the connections to it similarly.

I wanted the LEDs on the charger and the Bluetooth modules to be visible, so I removed the on-board SMD LEDs and wired the pads to 3mm LEDs. I drilled holes in the box for these since I hadn't allowed for them in my 3D printed box. I connected them to the solder pads on the modules with solderable enameled wire. This is coated in self fluxing polyurethane which melts under the heat of a soldering iron.

For the charger module, I used a red/green common anode LED. The common anode must be wired to either of the SMD LED pads closest to the edge of the board (which you can confirm with a multimeter). If your Bluetooth module has an SMD LED you will have to determine the polarity with a multimeter. Some modules have connections for an external LED.

Before inserting the headphone amp into the box over the other modules, I found it necessary to place small pieces of PVC tape on the tops of two electrolytic capacitors on the Bluetooth module and on the mini-USB charging socket so as to prevent shorts with the underside of the headphone amp.

Step 10: Enhancements

If I were wanting to turn this into a product there are undoubtedly things I'd change, but having made myself a gadget which serves my purpose, I'll be moving on to other projects.

The circuit:

  • A bipolar power supply might have been better. Since the current drawn by the opamps is small, a capacitive pump voltage inverter such as MAX660 would have easily provided the negative supply.
  • With a bipolar supply, the 5V boost converter would not be needed by the op amps. The LM4880 headphone amplifier will work on the raw output voltage from a LiPo battery though the maximum output power will be reduced from 250mW per channel to around 100mW per channel.

The board:

  • The board size is just what it came out from the layout process, but squashing it down to an exact size such as 6x6cm would have made design of the box a little easier.
  • Likewise, it would have been neater to have placed the input and output 3.5mm jacks in line and exactly in the middle of the two sides. This would also have facilitate the box design.
  • It would have been simple to on-board the LiPo charger circuit. The 3 - 5V boost converter would not be needed with a bipolar supply, so saving 2 separate modules.
  • With a simple TP4056 charger as used, the battery can be over-charged if you try to charge it with the unit switched on. Slightly more sophisticated chargers include a simple protection circuit, which would be worth including.
  • With the above modifications, the switch could then be mounted on the board. The method of mounting the switch in the 3D printed box wasn't ideal.
  • A 2 pole 3 way switch would allow the Bluetooth module to be powered only when needed.

The box:

  • Mounting the modules in 2 layers made assembly harder than it needed to be, and a thinner but larger box might have fitted a pocket better.
  • The switch is easily turned on inadvertently. It would have been simple to include guards around it in the 3D print design to prevent this.

Other applications:

If, perhaps as an audiophile, you just want an equalised headphone amp giving both boost and cut at a variety of frequencies you can use essentially the same design.

To give both boost and cut, eliminate R113, R123, R133 and R213, R223, R233 (or replace by 0Ω resitors) and replace the trimpots by 10k (slider pots if you prefer).

You can add as many instances of the gyrator circuit as you need.