Skip to content

Introduction

This tutorial will guide you through how to build your own wireless and/or wired headphones with ambient microphones. We start with some off-the-shelf headphones intended for use while lawn mowing, and then hack in some new electronics to allow wireless (BT), auxiliary 3.5mm TRS input, and stereo ambient microphones. The original purpose of this project was to make it easy and safe to play loud music with a rock band in the basement, however, the inclusion of the natural sounds around you into your listening experience can be useful in many other situations.

Background

The first prototype design was sparked up around the time I was designing the Qwiic Speaker Amp in August of 2022. Now, over a year later, it has been through three major versions:

With this project, I was trying to solve three problems:

  1. ) I want to be able to lower all barriers to practicing music. The less things I have to set up, the better!

  2. ) When I play drums, I need to protect my ears from getting damaged from exposure to extremely loud sounds. To do this, I usually wear in-ear monitors (IEMs). IEMs are kind of like headphones, but they are more like earbuds. They are usually custom-molded to your ear canal. In this way, they are actually working much like ear plugs and blocking out loud sounds while still providing sound to your ears. In order to get a great monitor mix, I then need to set up mics and a sound mixer. You can accomplish this with headphones too, but most do not provide a safe amount of sound-isolation. IEMs are great, but they are also very expensive. They can range from $300 to $3,000.

  3. ) My eight year old son is playing loud music more and more (acoustic drums, amplified guitar and keyboards), and I want him to be able to protect his hearing while still being able to rock out and hear the music clearly. Over-the-ear hearing protection (aka “Ear Muffs”), do a great job of protecting your hearing, but they also dampen the sound way too much. In addition to missing out on many of the mid and high frequencies, it can be very difficult to hear your own instrument and even your band mates.

My idea of a perfect solution:

  • Over-the-ear headphones that have stereo ambient mics to mix in!

  • Very easy to “pop on”, with no cables attached. Nothing to wire up, just pop them on and go.

  • Mix in a desired level of the ambient mics using a single knob, essentially a “more ears” knob - right there on my headphones, at the ready to adjust as needed.

  • Battery powered, 100% self contained, wireless. During some jam sessions with the kiddos, we will quickly trade instruments. We need to be able to jump around the room, free from wires and/or plugging and unplugging things.

  • The ability to mix in a line level audio source (for practice tracks or other monitor signals from a mixer). This could come in handy for more advanced monitor sound system setups, where maybe I am getting a feed from the mixer that contains the rest of the musicians I am playing with.

  • And icing on the cake, a Bluetooth® optional input. This last thing was really more useful for me during my solo practice sessions. I can load my phone up with my practice tracks and wirelessly connect to my headphones. Also, of course, useful for general listening.

Headphones

For this project, we chose over-the-ear headphones that provide a large amount of sound dampening (30dB). These types of headphones are also called ear-muffs and are often marketed for use during loud construction work or lawn mowing.

The exact headphones we chose to start with were the following:

When using this type of lawn-mowing headphones without any modification, they provide adequate sound dampening to protect your ears in extremely loud places. However, with this benefit, you also lose the ability to hear your natural surroundings clearly. Usually, it is described as sounding a bit like two pillows are held to either ear. This is because the passive sound dampening is blocking most of the high frequencies.

In order to get the sound clarity back, we need to use ambient microphones. The correct type of microphone can accept the loud sound sources without distortion. This type of microphone is said to have a high acoustic overload point, or AOP. We can send that clean audio signal from the microphones into the headphones at a safe listening level. In addition to a high AOP, the microphones also need to have a large signal to noise ratio (SNR), which helps avoid having too much "hiss" in the audio signal. Choosing the best microphone for the job turned out to involve a lot of testing. More on this later.

The Modification

In addition to sound dampening, the original electronics included the ability to listen to FM radio and plug in a 3.5mm TRS audio cable. In this tutorial, we will remove the stock electronics, and replace them with the SparkFun ESP32 Thing Plus and the WM8960 Audio Codec. The following two pictures show a comparison of the original electronics (blue) and our new version (green/red/black). We took pictures of the topside and backside of each for a more thorough comparison.

The new version actually includes three PCBs. The red microcontroller is the SparkFun Thing Plus ESP32. The black PCB is an early prototype of the SparkFun Audio Codec Breakout. The green PCB below is a custom "motherboard" that makes some connections between the two dev boards and provides the on/off/volume knob, 3.5mm TRS input, and mounting holes to mount this entire assembly into headphone can.

Click images for a closer view.

Using the WM8960 Audio Codec Breakout, we can mix together sound sources. In this use case, we are mixing together three sound sources:

  1. ) Wireless (aka "BT") audio from the ESP32 to the codec via I2S audio.

  2. ) Wired audio from a 3.5mm TRS audio jack (common headphone cable connector).

  3. ) Ambient microphones mounted to either sides of each ear-can, to provide a pair of stereo room mics to your listening experience. In a way, these microphones are "giving you your ears back". Most importantly, doing so at a safe volume, to prevent hearing loss.

Required Materials

To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary.

Tools

You will need to solder various connections using hook-up wire, microphone cable, PTH/SMD parts, and header pins. You may already have a few of these items but if not, the tools and hardware below will help. See suggested reading below for any help with learning or refreshing these assembly skills.

Suggested Reading

If you aren’t familiar with the following concepts, we also recommend checking out a few of these tutorials before continuing.